Scaling Writes hard
Google BigTable and CockroachDB use Range Sharding (splitting data by alphabetical ranges). How do they handle a 'Hot Shard' that grows too large?
- A They reject writes.
- B Dynamic Splitting: The system detects the tablet size/load limit and automatically splits the range into two smaller ranges, moving one to a different node.
- C They switch to Hash Sharding.
- D They compress the data.
Answer: B. Dynamic Splitting: The system detects the tablet size/load limit and automatically splits the range into two smaller ranges, moving one to a different node.
Range sharding preserves locality (good for scans) but risks hotspots. Automatic splitting and rebalancing allow the system to adapt to uneven write patterns without manual intervention.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What does the 'Atomicity' property in a database transaction guarantee regarding writes?
- Your database is struggling with write traffic. You decide to 'Scale Up' (Vertical Scaling) by buying a bigger server. What is the eventual hard limit of this strategy?
- A developer sets up a 'Fire-and-Forget' write pattern (sending data without waiting for a database confirmation) to speed up the app. What is the major risk?
- Why is inserting 1,000 rows in a single 'Batch' query faster than executing 1,000 separate `INSERT` queries?
- In the Raft consensus algorithm, what mechanism prevents a 'Split Vote' (where no leader gets a majority) from stalling the cluster indefinitely?
- Your 'Logs' table has 10 billion rows and writes are getting slow. You barely access logs older than 1 year. What is the simplest strategy to improve performance?