Skip to content
Veltoryx Technologies

Consistent Hashing & Ring Rebalancing Visualizer

Visualize how consistent hash rings distribute cache keys across server nodes with virtual nodes (vnodes). Compare minimal key relocation vs. naive modulo hashing during scaling.

Runs in your browser. Nothing is uploaded.

Cluster Node Configuration

Simulates 120 distributed cache keys placed on a 360° consistent hash ring.

Server-A
Server-B
Server-C
Virtual Nodes per Physical Node:20 virtual tokens

Higher virtual nodes evenly disperse keys around the hash ring, minimizing standard deviation and hot spots.

Key Allocation Distribution

Balance Deviation: 28.6
65%
27.5%
Server-A78 keys (65%)
Server-B33 keys (27.5%)
Server-C9 keys (7.5%)

What happens when adding 1 node (Server-D)?

Comparing key relocation overhead during horizontal scaling:

Consistent Hashing (With VNodes)~0% of keys moved

Only keys belonging to the adjacent ring segment are transferred. The remaining ~100% remain cached safely.

Naive Modulo Hashing (hash % N)~74.2% of keys moved

Almost all keys change assigned buckets, triggering a massive cache avalanche and database crash.

How to use this tool

1
Configure cluster nodes

Add or remove server nodes to model your distributed caching or storage cluster.

2
Tune virtual nodes slider

Adjust virtual nodes per physical node to observe how standard deviation drops and keys distribute symmetrically.

3
Examine horizontal scaling relocation

Compare how many keys must relocate when adding a node under Consistent Hashing (~K/N) versus naive Modulo Hashing (~100%).

Frequently Asked Questions

Why does naive modulo hashing (hash % N) fail during horizontal scaling?

When N changes from 3 to 4, nearly 75% of existing keys produce a different remainder (hash % 4 != hash % 3). This invalidates cached data across the entire cluster, causing a catastrophic database cache stampede.

How do virtual nodes (vnodes) prevent hotspots?

With only 1 token per physical node, hash collisions can leave large gaps on the ring, assigning one node 50% of the traffic. Virtual nodes assign 20 to 100 points per physical node across the ring, evening out the statistical distribution.

Which production systems use consistent hashing?

Apache Cassandra, Amazon DynamoDB, Akamai CDN, Discord gateway routing, and Redis Cluster all utilize consistent hashing for partition placement and peer routing.

How are keys mapped on the ring?

A key's hash is calculated, and the system moves clockwise around the 360° ring until encountering the first virtual node token. The physical node owning that token serves the request.

📖 Related Lessons on Veltoryx Learn

Deepen your architecture knowledge with practical, production-tested guides:

Client-Side Privacy Guarantee

This tool never transmits your payloads to any server. Open DevTools (F12) → Network tab to verify that zero HTTP requests are sent while using this page.

🛡 Safe for confidential enterprise payloads