Hi guys,
i'm trying to play with redis and newbie about redis. Redis Cluster design says that it does not use consistent hashing, but a different form of sharding where every key is conceptually part of what is called as hash slot. There are 16384 hash slots in Redis Cluster, and to compute what is the hash slot of a given key, we simply take the CRC16 of the key modulo 16384. Every node in a Redis Cluster is responsible for a subset of the hash slots, so for example we have a cluster with 3 nodes, where:
- Node A contains hash slots from 0 to 5500.
- Node B contains hash slots from 5501 to 11000.
- Node C contains hash slots from 11001 to 16383.
i've few question regarding this type of sharding :
1. what will happen if i've a cluster with more than 16384 masters? there will be some masters without any slot, means without any data ?
2. The slot distribution in the above three nodes cluster is default ? i means , the slots are equally distributed among the N nodes if i start a cluster with N nodes ?
3. As slot is identified based on CRC16(key)%16384, there is a possibility that some nodes will contain all data and other nodes may remain empty ? There is any way for equal or almost equal distribution of data among the cluster's nodes?
Best regards
Shihab