Caching hard
What is the primary function of 'Virtual Nodes' in a Consistent Hashing ring?
- A To support the deployment of virtual machines on the same physical hardware without requiring specialized hypervisor level configuration.
- B To provide a secure, hardware-accelerated encryption layer for every individual data packet as it traverses the consistent hashing ring.
- C To ensure uniform data distribution by mapping one physical node to many positions on the hash ring, thereby preventing the creation of 'Hot Shards'.
- D To enable an automated failover mechanism that redirects traffic to a secondary standby node whenever a heartbeat signal is lost by the ring.
Answer: C. To ensure uniform data distribution by mapping one physical node to many positions on the hash ring, thereby preventing the creation of 'Hot Shards'.
**Virtual Nodes** (VNodes) solve the data imbalance problem. Instead of mapping one physical node to one point on the hash ring, it maps to multiple points (e.g., 200 tokens). This statistically ensures a more uniform distribution of keys across physical nodes and minimizes the data movement required when a node is added or removed (only ~1/N keys move).
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In the Cache-Aside pattern, what happens when the application requests data that is missing from the cache (a 'Cache Miss')?
- Why use a centralized Distributed Cache (like a Redis Cluster) over local in-memory caches on each web server?
- Setting a short TTL (e.g., 60 seconds) on a cached object helps to:
- What is the primary architectural goal of introducing a cache into a system?
- Most caching systems rely on the principle of 'Temporal Locality', which states:
- Your cache uses an LRU (Least Recently Used) eviction policy. When the cache is full, which item is removed?