Consistent Hashing Explained: How Distributed Systems Avoid Mass Data Reshuffling
Consistent hashing is a technique used in distributed systems to minimize data movement when nodes are added or removed. Unlike naive modulo-based hashing, which remaps nearly all keys when the node count changes, consistent hashing places both nodes and keys on a shared hash ring. A topology change then affects only the keys belonging to the altered node, moving roughly 1/N of the keyspace instead of all of it. To prevent uneven load distribution, each physical node is represented multiple times on the ring through virtual nodes, with 150 replicas being a common default. The approach is widely used in distributed caches, sharded databases, CDN edge selection, and load balancers that require stable, scalable key routing.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in