All Questions
Scaling Reads medium

You shard your 'Orders' database by `Order_ID`. Your Analytics team needs to run a query: `SELECT * FROM Orders WHERE Date > '2023-01-01'`. Why is this query inefficient?

  1. A Sharded databases do not support dates.
  2. B It causes a 'Scatter-Gather' operation: The query must be broadcast to *every* shard because the Shard Key (`Order_ID`) is not part of the filter (`Date`).
  3. C The query is too simple.
  4. D It will cause a deadlock.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions