Redis medium
How does Redis Cluster distribute its keyspace across multiple nodes to achieve linear scalability?
- A It uses a Consistent Hashing ring to map keys to the nearest physical node in the network topology.
- B It uses 16,384 Hash Slots; every key is mapped to a slot, and nodes own a specific range of slots.
- C It relies on a central Primary Node that maintains a global routing table for all incoming client requests.
- D It uses a simple Round-Robin load balancer to cycle through the available nodes for every individual write.
Answer: B. It uses 16,384 Hash Slots; every key is mapped to a slot, and nodes own a specific range of slots.
Hash Slots abstract keys from nodes. If you add a third node to a 2-node cluster, Redis simply moves 5,461 slots (and their data) from the existing nodes to the new one without downtime.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- If the Redis memory limit is reached, what specific behavior is exhibited by the `allkeys-lru` eviction policy?
- What is the defining characteristic of a Redis 'Set' data type compared to a standard Redis 'List'?
- In the context of Redis messaging, what is the functional definition of the 'Pub/Sub' feature?
- How does the Redis background snapshotting process (`BGSAVE`) leverage the operating system's `fork()` mechanism to minimize memory overhead?
- Why does Redis proactively disconnect a Pub/Sub client that exhibits high 'output buffer' usage relative to its ingestion rate?
- How does a 'Sorted Set' (ZSET) manage its internal membership and ordering differently from a plain Set?