Consistent Hashing easy
When a new node (Node X) joins the ring, where does it acquire its initial data from?
- A It downloads a full, compressed copy of the entire database from a centralized archival backup server.
- B It performs a broadcast request to all nodes in the cluster and aggregates all keys that match its hash range.
- C It splits the existing data shards of the node that is its immediate predecessor on the virtual ring.
- D It takes ownership of a specific subset of keys that were previously assigned to its immediate successor node.
Answer: D. It takes ownership of a specific subset of keys that were previously assigned to its immediate successor node.
In a consistent hashing ring, adding a node only affects its immediate clockwise neighbor (the successor). The new node 'inserts' itself into the ring and takes responsibility for the hash range it now covers, which was previously owned by the successor. This minimizes data movement compared to non-consistent methods where almost all data might move.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In a 'Smart Client' architecture (e.g., modern Cassandra drivers), how does the client find the right node?
- Google's Maglev hashing algorithm (used in their Network Load Balancers) differs from standard Consistent Hashing rings. How does it generate the lookup table?
- Virtual Nodes improve balance but increase metadata size (Memory). How does 'Multi-Probe Consistent Hashing' achieve good balance without VNodes?
- In the Chord DHT protocol (a P2P consistent hashing implementation), naive lookups are O(N). How does Chord optimize this to O(log N)?
- Which of these systems is a famous user of Consistent Hashing?
- If you reside a cluster from 10 to 11 nodes using Modulo Hashing, what happens?