Sharding hard
If Shard A fails in a large cluster, and its incoming traffic is automatically re-routed to Shard B, what is the risk of a 'Cascading Failure'?
- A Shard B, suddenly receiving its own load plus the added load from Shard A, may also crash, triggering a domino effect that brings down every shard in the cluster.
- B The existing data on Shard B will be automatically deleted to make room for the incoming data from Shard A.
- C Latency on Shard B will actually improve because it can now parallelize multiple workloads more effectively.
- D The database router will simply drop all incoming requests rather than overloading any other physical hardware.
Answer: A. Shard B, suddenly receiving its own load plus the added load from Shard A, may also crash, triggering a domino effect that brings down every shard in the cluster.
This is a nightmare scenario for distributed systems engineers. When one shard dies, the remaining shards are under more pressure. If Shard B was already at 70% capacity, adding Shard A's traffic will push it over 100%, causing it to fail. The traffic then hits Shard C, which fails even faster. To prevent this, robust systems implement 'Load Shedding'—the system detects the overload and proactively rejects a percentage of requests ('Failing Fast') to protect the remaining shards from total annihilation.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- In an E-Commerce platform, why might you choose to shard the `Orders` table by `user_id` rather than the more obvious `order_id`?
- In the context of database scaling, what is the fundamental difference between 'Vertical Partitioning' and 'Horizontal Partitioning' (Sharding)?
- In a standard 'Modulo Sharding' setup (`key % N`), what is the primary consequence of adding a new server to the cluster (increasing N from 10 to 11)?
- From an engineering perspective, when should you choose 'Vertical Scaling' (a bigger server) over 'Horizontal Scaling' (Sharding)?
- Which sharding strategy is mathematically optimized for efficient 'Range Scans' (e.g., retrieving all records created between January and March)?
- In a sharded architecture, what does the 'Scatter-Gather' query pattern imply for application performance?