Beyond One Node
A single Redis node is bounded by its RAM and one CPU core for command execution. Redis Cluster scales out by sharding the keyspace across many nodes so the dataset and throughput grow horizontally.
Hash Slots
Cluster divides the keyspace into 16384 hash slots. Each key is hashed to a slot, and every slot is owned by exactly one primary node. To find a key, you find its slot, then the node that holds that slot.
- Keys are routed by CRC of the key name modulo 16384.
- Clients cache the slot to node map and redirect on a MOVED response when it changes.
Keeping Related Keys Together
Multi key commands only work when all keys live in the same slot. Hash tags, a substring in braces, force keys to hash on just that part, so user braces 42 braces profile and user braces 42 braces cart share a slot and can be used together.
Resharding and Failover
Slots can be migrated between nodes to rebalance as you add hardware. Each primary can have replicas; if a primary fails, a replica is promoted so its slots stay available.
Key idea
Redis Cluster shards keys across 16384 hash slots owned by primary nodes, using hash tags to colocate related keys and slot migration to rebalance.