Consistent hashing is a technique used in some NoSQL implementations. However, for those who try to understand what consistent hashing is, online papers usually talk about abstract stuff that is quite hard to understand for mere mortals. For instance, The wikipedia entry states :
Consistent hashing is a scheme that provides hash table functionality in a way that the addition or removal of one slot does not significantly change the mapping of keys to slots. In contrast, in most traditional hash tables, a change in the number of array slots causes nearly all keys to be remapped. By using consistent hashing, only K/n keys need to be remapped on average, where K is the number of keys, and n is the number of slots.
Add a few acronyms and formulas, and you have everything you need to kill a Buffalo.
The good news is that I came across this blog entry on consistent hashing that makes it really easy to understand what consistent hashing is used for, and how to implement it. It’s actually quite easy in the end
It would be nice if, when a cache machine was added, it took its fair share of objects from all the other cache machines. Equally, when a cache machine was removed, it would be nice if its objects were shared between the remaining machines. This is exactly what consistent hashing does - consistently maps objects to the same cache machine, as far as is possible, at least.