Systems & Backend

Consistent Hashing

Mapping keys and nodes onto a ring so adding a node moves only ~K/N keys, not all of them.

Consistent hashing places servers and keys on the same hash ring; a key belongs to the next server clockwise. Adding or removing a node only remaps the keys in its arc — on average K/N — instead of the whole keyspace, which is why it backs distributed caches and databases.