Sharding medium
If you perform 'Range Sharding' using a monotonically increasing Shard Key (e.g., a simple `Timestamp` or `SerialID`), what specific performance failure are you most likely to encounter?
- A The cluster will achieve perfect, automatic balancing of all incoming data across all existing nodes.
- B The database will reject the writes because the IDs are being generated too quickly for the storage engine to keep up.
- C Overall system latency will improve because the database can predict where the next record will land.
- D You will create a massive 'Write Hotspot' on the very last shard, as all new incoming traffic (by definition) belongs to the most recent range.
Answer: D. You will create a massive 'Write Hotspot' on the very last shard, as all new incoming traffic (by definition) belongs to the most recent range.
This is a widespread engineering pitfall. If you shard by month (Shard 1 = Jan, Shard 2 = Feb), then during the month of February, 100% of your write traffic will hit Shard 2. Shard 1 will sit completely idle, effectively wasting its hardware. When March begins, the load 'flashes' over to Shard 3. This 'Hot Range' means you never actually gain the benefits of horizontal scaling for writes. To fix this, high-performance systems use 'Hash-Based' sharding to scatter those new timestamps across every server in the cluster simultaneously.
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)?
- 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'?
- 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)?