Algorithms and Data Structures · Senior · Question 12 of 75
What advantage does consistent hashing give a distributed cache?
- ✓Correct answer: Adding or removing a node remaps only about 1/n of the keys
- 2Lookups no longer need a hash function at all
- 3Every key is stored on every node for redundancy
Explanation
With hash(key) % n changing n reshuffles almost every key. On a hash ring a key goes to the next node clockwise, so only keys near the changed node move. Virtual nodes smooth out the load.