Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis cluster/consistent hash #4001

Open
go-slark opened this issue Mar 12, 2024 · 6 comments
Open

redis cluster/consistent hash #4001

go-slark opened this issue Mar 12, 2024 · 6 comments
Labels
answered Marks an issue as answered

Comments

@go-slark
Copy link

In redis cluster mode, go-redis can calculate the hash slot where the key resides and route it to the selected node. Why still need consistent hash?

@MarkJoyMa
Copy link
Collaborator

The purpose of this implementation is to save costs, because the redis network bandwidth on Alibaba Cloud is linked to capacity. If you use a larger bandwidth, you can only upgrade the redis specifications. However, in some cases, your business does not need such a large bandwidth. redis capacity, then you can choose to use several small redis combinations. We saved 8 times the cost by using this method.

@MarkJoyMa MarkJoyMa added the answered Marks an issue as answered label Mar 14, 2024
@go-slark
Copy link
Author

The purpose of this implementation is to save costs, because the redis network bandwidth on Alibaba Cloud is linked to capacity. If you use a larger bandwidth, you can only upgrade the redis specifications. However, in some cases, your business does not need such a large bandwidth. redis capacity, then you can choose to use several small redis combinations. We saved 8 times the cost by using this method.

Are these small capacity redis selected to form a cluster a shard cluster? If it is not a sharded cluster, how is the node change data migration implemented?

@go-slark
Copy link
Author

go-slark commented Mar 15, 2024

Other question, why not just use codis? thx @MarkJoyMa

@MarkJoyMa
Copy link
Collaborator

The purpose of this implementation is to save costs, because the redis network bandwidth on Alibaba Cloud is linked to capacity. If you use a larger bandwidth, you can only upgrade the redis specifications. However, in some cases, your business does not need such a large bandwidth. redis capacity, then you can choose to use several small redis combinations. We saved 8 times the cost by using this method.

Are these small capacity redis selected to form a cluster a shard cluster? If it is not a sharded cluster, how is the node change data migration implemented?

Why do you need to migrate? If there are new or reduced nodes in the cache cluster, just re-obtain the db normally. This is only used as a cache.

@MarkJoyMa
Copy link
Collaborator

Other question, why not just use codis

codis is a distributed Redis solution. It is not equivalent to the cache here. In other words, the capabilities provided by the cache are functionally equivalent to the sharding logic of codis. It does not provide a distributed Redis solution.

@MarkJoyMa
Copy link
Collaborator

Another point, we have to pay attention to a core issue, what is the purpose of the cache array here? It is not to solve the redis distribution problem, but to achieve the purpose of cost control. As for using redis node cluster, codis or other redis solutions, it does not matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Marks an issue as answered
Projects
None yet
Development

No branches or pull requests

2 participants