Advanced System design concept · Distributed Systems & Data · 23 mins read
Database Scaling Techniques
How teams stretch a single database before and after it becomes the bottleneck.
Sharding
Split data across multiple databases so one writer is no longer the only write destination.
Intuition
One primary can serialize only so many writes, indexes, and bytes before latency and lock contention spike. Sharding spreads that load across multiple databases. Split data across multiple databases so one writer is no longer the only write destination.
Mental Model
Route users, tenants, or orders by a shard key so writes land on many nodes instead of one overloaded leader.
Examples
- Route users, tenants, or orders by a shard key so writes land on many nodes instead of one overloaded leader.
When to Avoid
Cross-shard joins, rebalancing, and global indexing get painful fast, and a bad key just creates hot shards. Shard only after simpler fixes stop buying headroom.
Indexing
Use targeted indexes to turn expensive scans into fast lookups on the fields users actually query.
This section is part of the full PRISM roadmap, with worked examples, trade-off tables, interview questions and a quiz.
Unlock the full lessonPractice database scaling techniques in PRISM
Concepts stick when you watch them fail. Build an architecture that depends on database scaling techniques, push traffic through it in the PRISM simulator, and see the latency and error rates change as you adjust the design.