Why is sharding necessary when you could just scale up the database server?
Vertical scaling (a bigger machine) has a real ceiling — at some point no single instance, however powerful, can hold the data or serve the traffic. Read replicas help with read scaling but don't help write throughput, since writes still funnel through one primary. Sharding is the technique that scales writes and storage horizontally, by splitting data across multiple independent machines instead of growing one.
Answered in
Database Sharding: What It Actually Costs When You Split the DatabaseSharding scales a database past one machine's limits, but it changes joins, transactions, and query patterns. Here's what each strategy trades away.
Read the full analysisOther questions this article answers
More system design & architecture questions
- How much spare capacity should a gateway keep?
- Why are bounded queues important for availability?
- Should a load balancer always move requests away from an unhealthy server?
- Can a circuit breaker prevent every cascading failure?
- Why does pagination improve API performance beyond just 'smaller responses'?
- Why is asynchronous logging faster than writing logs synchronously?
- When does caching actually help API performance, and when doesn't it?
- Why does payload compression trade CPU time for network time, and when is that worth it?
Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design & Architecture beat.