Loading section...
Consistent Hashing — Distributed Key Assignment Without Reshuffling
Consistent hashing is the algorithm behind how Kafka assigns partitions, Cassandra routes requests, and DynamoDB distributes keys. When a new node is added to a cluster, a naive hash (key % num_nodes) requires reassigning almost all keys. Consistent hashing limits key reassignment to K/n keys, where K is the total number of keys and n is the number of nodes. This is one of the most impressive algorithms a staff DE candidate can explain from first principles. DE Applications of Consistent Hashing