Route by key without thrashing the map when nodes change.
Sticky Sessions and Consistent Hashing: route by key without thrashing the map when nodes change
move the first decision closer to the user
Consistent hashing reduces churn massively.
Sticky sessions pin a user to one server (e.g., for session affinity). Consistent hashing pins keys to nodes such that adding or removing a node only moves a small fraction of keys.
Naive mod-N hashing remaps every key when N changes; consistent hashing remaps only ~1/N.
Use cases: cache shards, distributed queues, partitioned services.
Virtual nodes balance load when ring is uneven.
Cache cluster of 5 nodes growing to 6.