Sharding medium
What is the main operational difference between 'Manual Sharding' (traditional SQL) and 'Auto-Sharding' (modern Distributed SQL/NoSQL)?
- A Auto-sharding eliminates the need for human developers to write any SQL or interaction code.
- B Auto-sharding provides an automated background service that monitors load and transparently moves 'chunks' of data between nodes to keep the cluster balanced.
- C Manual sharding is faster because the application developer can hand-pick the physical disk for every record.
- D Auto-sharding is primarily a security feature that periodically rotates the data across nodes to prevent intrusion.
Answer: B. Auto-sharding provides an automated background service that monitors load and transparently moves 'chunks' of data between nodes to keep the cluster balanced.
In systems like MongoDB or CockroachDB, 'Sharding' is a core feature, not a manual overlay. The database tracks the size and traffic of each 'range' or 'chunk' of data. If one server becomes 90% full while another is 20% full, the database will automatically move data in the background to even things out. In traditional SQL (like legacy MySQL), this type of rebalancing required high-risk manual scripts, custom proxy logic, and often significant application downtime.
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)?