Consistent Hashing Ring Generator
With plain modulo hashing, adding one server rehashes almost every key. Consistent hashing places nodes around a ring and gives each key to the next node clockwise, so adding a node moves only the keys that now belong to it — about one share, not everything. This builds a ring, measures the load on each node, then adds a node and counts exactly what had to move.
What this generator does
Places each node at several hashed points around a ring, assigns every key to the next node clockwise, and reports the load per node. It then adds a node and recomputes every assignment to count what moved and where it went.
How to use this tool
- Choose how many nodes and keys, and how many points each node gets.
- Run, and read the load on each node.
- Look at how many keys moved when a node was added.
- Drop the points per node to one and watch the loads go uneven.
Understanding the controls
- How many nodes
- Servers, shards or caches. Fewer nodes means each holds more, and a departure hurts more.
- How many keys
- More keys give steadier load figures and a fairer comparison between settings.
- Points per node
- Virtual nodes. With one point each, the gaps around the ring vary enormously and so do the loads; with a hundred the imbalance largely disappears.
Common use cases
- Sizing virtual nodes before implementing a hash ring
- Showing why adding a cache server need not invalidate everything
- Teaching consistent hashing with measured load figures
- Comparing load balance across different virtual-node counts
- Producing sharding examples for a design discussion
How this generator works
Each node is hashed at several points around a ring of hash values, and each key goes to the first node point at or after its own hash, wrapping around at the end. Adding a node inserts new points, and only the keys falling in the arcs those points now cover change hands. The tool recomputes every assignment after the addition and confirms two things: how many keys moved, and that every moved key went to the new node and nowhere else — the second is what consistent hashing actually promises.
Randomness and fairness
Nothing here is random. Node and key names are hashed deterministically, so the same settings always give the same ring.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Nodes are assumed equally capable, so weighted rings that give a larger server more points are not modelled.
- The hash is a simple non-cryptographic function, which suits distribution but not adversarial input.
- Removing a node is the mirror of adding one and is not shown separately.
- Real deployments also have to move the data itself, which is the expensive part this says nothing about.
Privacy and your data
The ring is computed in your browser and nothing you set is transmitted, stored or included in analytics.
Related generators
- Bloom Filter GeneratorFills a Bloom filter and measures its real false-positive rate against the predicted one, with every inserted item proved still present.
- Hash Table Scenario GeneratorKeys distributed into buckets by modulo hashing, with collisions, chain lengths and empty buckets all recounted from the table.
- Cache Scenario GeneratorThe ways a cache serves a wrong answer quickly — stale reads, herds on expiry, cached negatives, keys that collide across tenants.
- UUID Batch GeneratorFive fresh UUIDs at once, one per line.