All Questions
Sharding medium

Your social network is sharded by `user_id`. One specific 'Celebrity' user generates 10,000x more write traffic than the average user, creating a hotspot on Shard 1. How can you effectively bridge this write bottleneck?

  1. A Implement 'Sub-Sharding' for the celebrity's data by appending a random suffix to the shard key for their specific interactions (e.g., `celebrity_id_1`, `celebrity_id_2`).
  2. B Assign the celebrity a significantly larger integer ID to ensure it is prioritized by the database storage engine.
  3. C Add more 'Read Replicas' to Shard 1 to handle the increased load.
  4. D Relocate the celebrity to a shard with a faster NVMe SSD.

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

Get the app

Related questions