All Questions
Sharding medium

Your database is sharded by `user_id`, but you frequently need to look up users by their unique `email`. What is the primary technical trade-off of maintaining a 'Global Secondary Index' to support these queries?

  1. A It has no significant downside because modern databases keep all index data in the central router's RAM.
  2. B It significantly reduces the total storage capacity needed because the index replaces the need for full row replication.
  3. C It increases 'Write Amplification' and latency, as every new user registration now requires an atomic write to both the User Shard and the Index Shard across the network.
  4. D It makes read operations significantly slower than performing a full Scatter-Gather scan across all shards.

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

Get the app

Related questions