Algorithms and Data Structures · Senior · Question 12 of 75

What advantage does consistent hashing give a distributed cache?

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.

Further reading

Problem with a question

Algorithms and Data Structures · Senior · question 12

Test yourself

Take the Algorithms and Data Structures · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz