Modulo hashing can have drawbacks that ring-based hashing mitigates. Which of the following describes a drawback of modulo hashing?

Test your Systems Design Concepts knowledge with our comprehensive quiz. Utilize flashcards and multiple choice questions to enhance your study session. Prepare thoroughly with detailed explanations for each answer and ace your examination!

Multiple Choice

Modulo hashing can have drawbacks that ring-based hashing mitigates. Which of the following describes a drawback of modulo hashing?

Explanation:
Understanding how keys are distributed and what happens when the system grows or shrinks is essential here. In modulo hashing, each key is assigned to a node using hash(key) mod N, where N is the current number of nodes. When capacity changes, N changes for everyone, so the mapping for many keys shifts. This leads to large amounts of data needing to move between nodes and can create hotspots, where certain nodes end up handling a disproportionate share of the load during rebalancing. Ring-based hashing (consistent hashing) avoids most of that. Both keys and nodes are placed on a circular hash space, and a key is handled by the first node clockwise from its hash. When a node joins or leaves, only the keys in the affected small arc move to the neighboring node, keeping the rest steady. That minimizes data movement and reduces hotspots. So the described drawback of modulo hashing is exactly that it can cause substantial data movement and hotspots during capacity changes.

Understanding how keys are distributed and what happens when the system grows or shrinks is essential here. In modulo hashing, each key is assigned to a node using hash(key) mod N, where N is the current number of nodes. When capacity changes, N changes for everyone, so the mapping for many keys shifts. This leads to large amounts of data needing to move between nodes and can create hotspots, where certain nodes end up handling a disproportionate share of the load during rebalancing.

Ring-based hashing (consistent hashing) avoids most of that. Both keys and nodes are placed on a circular hash space, and a key is handled by the first node clockwise from its hash. When a node joins or leaves, only the keys in the affected small arc move to the neighboring node, keeping the rest steady. That minimizes data movement and reduces hotspots.

So the described drawback of modulo hashing is exactly that it can cause substantial data movement and hotspots during capacity changes.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy