Consistent Hashing medium
What is a typical guideline for the number of Virtual Nodes per physical node to ensure balanced load?
- A A quantity that ensures the statistical standard deviation of the load remains within an acceptable range (e.g., 256 tokens).
- B A count that is exactly equal to the number of physical storage drives or CPU cores available on the underlying host.
- C Exactly 1 token per physical server to minimize the overhead of metadata propagation and ring lookup logic.
- D Millions of tokens per node to ensure that even the smallest physical key is perfectly balanced across the entire cluster.
Answer: A. A quantity that ensures the statistical standard deviation of the load remains within an acceptable range (e.g., 256 tokens).
Tuning the VNode count is a balance between distribution quality and metadata overhead. With only 1-5 VNodes, the 'luck of the draw' causes large imbalances. With ~256 VNodes (a common Cassandra default), the law of large numbers ensures that load is distributed to within roughly 5-10% of equal across all nodes without overwhelming the system with metadata.
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?
- When a new node (Node X) joins the ring, where does it acquire its initial data from?
- 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?