Skip to content

Archive

Consistent Hashing

1 articles
Software Engineering 20 Sep 2026 6 min read

Consistent Hashing Limits Key Movement When Nodes Change

Partitioning by hash(key) % N is simple when the node count stays fixed. The arithmetic becomes disruptive when N changes. Moving from four nodes to five changes the divisor, so many keys select a different remainder even though only one node joined. Consistent hashing changes the mapping. Keys and nodes are placed in the same circular hash space. A key belongs to the first node encountered in a chosen direction around the ring. Adding or removing a node changes ownership only for ranges adjacent to that membership change.