Suggest an editImprove this articleRefine the answer for “How are slots distributed among nodes?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)In Redis Cluster, every key is distributed across 16384 hash slots using the formula `CRC16(key) % 16384`; when the cluster is created, slots are spread evenly across all master nodes, and adding a new master moves some slots from the existing ones onto it (resharding). **Key point:** replicas don't receive slots directly - they simply copy their master's data, so a read request to a replica only works with the data of the master it's subordinate to.Shown above the full answer for quick recall.Answer (EN)ImageIn Redis Cluster, **every key is distributed across 16384 hash slots**, and those slots are split among the master nodes. ### 1. Hash slots - There are 16384 slots in total (0-16383). - Every key lands in a slot via this formula: ```javascript CRC16(key) % 16384 ``` - The slot determines which master holds the key. ### 2. Distributing slots among master nodes - When the cluster is created, slots are **spread evenly** across all master nodes. An example with 3 masters: ```javascript master1 → slots 0-5460 master2 → slots 5461-10922 master3 → slots 10923-16383 ``` - If a new master is added, some slots get moved from the existing masters onto it. ### 3. Replicas - Replicas **don't receive slots directly**. - They simply copy their master's data. - So a read request to a replica only works with the data of the master it's subordinate to. ### 4. Redistribution during scaling - Redis Cluster supports **resharding**: - some slots move from an overloaded master to a new one; - the data for those slots **moves automatically**; - clients get notified about the slots' new location via `MOVED`. ### 5. Summary - Slots are a logical partitioning of keys. - Every master serves a specific range of slots. - Replicas copy their master's slots. - Adding new nodes or removing old ones comes with a redistribution of slots to balance the load. > This mechanism provides **horizontal scaling**, even load, and fault tolerance.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.