Fundamentals · Hard · Free
What is sharding? Horizontal vs vertical split.
FresherFundamentalsDatabase Fundamentals
Sharding
For What is sharding? Horizontal vs vertical split., interviewers listen for a crisp definition, how the pieces interact in a real system, and one trade-off or failure mode you have seen or would guard against.
| Horizontal | Vertical | |
|---|---|---|
| Split | Rows by shard key | Tables by feature |
| Example | user_id % 4 | billing DB vs catalog DB |
Sharding last resort—exhaust indexes + read replicas first.