Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

In a Redis cluster, do you choose odd or even nodes? (theory)

2025-03-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Let's analyze it through a set of examples:

3-node environment: 1 master, 2 slave

Storage space: maximum equal to the capacity of 1 node. (if it is 2 master, then part of the data will be lost)

Redundancy: 1 node failure is allowed.

4-node environment: 2 master, 2 slave

Storage space: the capacity of 2 nodes.

Redundancy: 1 node failure is allowed. (more than half of the nodes in the cluster will be elected only if they think it is a failure. )

5-node environment: 2 master, 3 slave

Storage space: the capacity of 2 nodes.

Redundancy: allows 2 node failures.

6-node environment: 3 master, 3 slave

Storage space: the capacity of 3 nodes.

Redundancy: allows 2 node failures.

And so on.

Comparison of 3 nodes and 4 nodes:

Capacity: the latter has an extra storage space of 1 node.

Redundancy: all allow 1 node failure.

Comparison of 4 nodes and 5 nodes:

Capacity: both are the capacity of 2 nodes.

Redundancy: the latter has 1 more node redundancy.

By comparison, it is found that whether the redis cluster chooses odd nodes or even nodes depends on the needs of the business.

For example: the total amount of data of the business can be met by 2 nodes, then it depends on the requirements of the business for redundancy.

If you have 1 redundancy on OK, then consider a cluster of 4 nodes.

If you want more redundancy, consider a cluster of five nodes.

But then again, since the enterprise has chosen the redis cluster, the company is not short of the money of this node.

The general practice is an even-numbered redis cluster.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report