Consistent hashing applies a hash function to the key (rather than using the raw key directly) and uses the result to choose which node stores the data:
n = node_count h = hash(key) save(mod(h, n), data)
When the hash table size (i.e., the number of nodes) changes, only about keys are remapped on average. With URL-based hashing, a given request consistently routes to the same node. The idea was originally developed for web caching to maintain a high cache hit rate even as cache nodes are added or removed, and it is also used to reduce reallocation issues when scaling systems like Redis. In practice, servers form a hash ring so that adding or removing nodes causes minimal data movement.

Seonglae Cho