Sharding medium
While primarily used for writes, what is the most significant way that 'Sharding' also improves total system Read Scalability?
- A It has no impact on read scalability; that is the exclusive role of Read Replicas.
- B By splitting the dataset, it distributes the read load across many physical machines, roughly multiplying the total read throughput of the cluster by the number of shards.
- C It automatically applies advanced compression to all read-heavy tables to fit more data into the CPU's L3 cache.
- D It reduces read performance overall to ensure that write consistency is always prioritized (according to the CAP theorem).
Answer: B. By splitting the dataset, it distributes the read load across many physical machines, roughly multiplying the total read throughput of the cluster by the number of shards.
Often, engineers think of Sharding for Writes and Replication for Reads, but Sharding is a powerful tool for both. If your 1 Terabyte database is on 1 server, that server's RAM and CPU are a bottleneck for every single read. If you shard it across 10 servers, you now have 10x the total RAM available to keep the 'Working Set' (the hot data) in memory. As long as your queries include the Shard Key, each server only processes 1/10th of the queries, allowing the entire cluster to handle significantly more traffic than a single machine could ever support.
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)?