System Design, Redis & Distributed Systems
10+ Years (Principal / Architect)
Hard
Production Scenario
How does Consistent Hashing minimize data movement during Cache Cluster node addition or removal?
Real-World Scenario / Incident Description
Adding a 5th Memcached server caused 80% of existing cache keys to remap and miss simultaneously using standard `hash(key) % N`.
786 views
•
Updated 1 month ago
Consistent Hashing Ring
- Maps both Cache Servers and Keys onto a 360-degree circular hash ring (e.g. 0 to $2^{32}-1$).
- A key is assigned to the nearest server located clockwise on the ring.
- When a server is added or removed, only $K/N$ keys need remapping, preventing total cache thrashing.
- Virtual Nodes: Assigns multiple virtual points per physical server to ensure even distribution across nodes.
Related Concepts:
#Consistent Hashing
#Virtual Nodes
#Caching
#Distributed Systems
More System Design, Redis & Distributed Systems Interview Questions
How does the Redis Redlock Algorithm provide Fault-Tolerant Distributed Locking across independent Redis nodes?
Read →
Explain the 3 High-Scale Cache Failure Patterns: Cache Avalanche, Cache Breakdown (Dog-Piling), and Cache Penetration, with mitigations.
Read →
Compare Rate Limiting Algorithms: Token Bucket, Leaky Bucket, Fixed Window Counter, and Sliding Window Log/Counter.
Read →
How do you design a Real-Time Notification System delivering to 10M concurrent users with WebSockets and Redis Pub/Sub?
Read →
How do you design an Idempotent Payment Processing Architecture with the Saga Pattern across Microservices?
Read →