Consistent hashing maps keys to nodes while limiting remapping when cluster membership changes. It reduces the data migration required when nodes join or leave a distributed cache. section 12.2.2
Use it when a simple mapping becomes difficult to operate:
- Adding or losing a node changes ordinary mapping rules and can redirect many keys. section 12.2.2
- Migrating redirected data while keeping the service running adds operational complexity. section 12.2.2
- Prefer the simpler mapping first when scalability requirements do not justify the added implementation complexity. section 12.2.2
Simple mapping before consistent hashing
A cache can sort visible nodes, hash a to-do list name with :erlang.phash2, select a node, and call Todo.Cache.server_process remotely. This illustrates the mapping problem that consistent hashing improves.

