Main
Interview Coaching
Learn
System Design
ML System Design
DSA
Behavioral
Interview Insights
Get Premium
Patterns
Scaling Writes
Learn about how to scale writes in your system design interview.
The Challenge
Many system design problems start with modest scaling requirements before the interviewer throws down the gauntlet: "how does it scale?" While you might be familiar with tools to handle the read side of the equation (e.g. read replicas, caching, etc.) the write side is often a much bigger challenge.
Bursty, high-throughput writes with lots of contention can be a nightmare to build around and there are a bunch of different choices you can make to handle them or make them worse. Interviewers love to probe bottlenecks in your solution to see how you would react to the runaway success of their next product (whether that's realistic or not is a separate discussion!).
Write Challenges
In this pattern we're going to walk through the various scenarios and challenges you should expect to see in a system design interview, and talk about the strategies you can use to scale your system.
The Solution
Write scaling isn't (only) about throwing more hardware at the problem, there's a bunch of architectural choices we can make which improve the system's ability to scale. A combination of four strategies will allow you to scale writes beyond what a single, unoptimized database or server can handle:
- Vertical Scaling and Database Choices
- Sharding and Partitioning
- Handling Bursts with Queues and Load Shedding
- Batching and Hierarchical Aggregation
Let's first talk about how we can scale while staying safely in a single-server, single-database architecture before we start to throw more hardware at the problem!
Vertical Scaling and Write Optimization
Vertical Scaling
Database Choices
Sharding and Partitioning
Horizontal Sharding
Vertical Partitioning
Handling Bursts with Queues and Load Shedding
Write Queues for Burst Handling
Load Shedding Strategies
Batching and Hierarchical Aggregation
Batching
Hierarchical Aggregation
When to Use in Interviews
Common Interview Scenarios
When NOT to Use in Interviews
Common Deep Dives
"How do you handle resharding when you need to add more shards?"
"What happens when you have a hot key that's too popular for even a single shard?"
Split All Keys
Split Hot Keys Dynamically
Conclusion

Schedule a mock interview
Meet with a FAANG senior+ engineer or manager and learn exactly what it takes to get the job.