Oleksii
Oleksii

Reputation: 41

Redis Cluster: Is it possible to obtain one hash slot from different keys?

As I know from Redis cluster tutorial, cluster has only 16384 slots (0 - 16383). The hashslots are calculated by following command: CRC16 (KEY) mod 16384. So for example CRC16 of some key equals 16385 and hash slot will be 1. For another key CRC16 equals 32769 and hash slot will be again 1. Is it cause some conflict? Or first one will be rewritten by second one?

Upvotes: 0

Views: 2179

Answers (1)

e7lT2P
e7lT2P

Reputation: 1921

If i understand your question, no this is not a conflict. Each key belogns to one hashsolt but each hashslot can have many keys.

enter image description here

CLUSTER GETKEYSINSLOT slot count: https://redis.io/commands/cluster-keyslot

Upvotes: 4

Related Questions