Database Scaling Cheat Sheet

Database scaling strategies — read replicas, connection pooling, vertical vs horizontal, caching layers, denormalization.

Last Updated: May 1, 2025

Key Concepts

ItemDescription
OverviewThis cheat sheet covers essential concepts and best practices for this topic.
Best PracticesFollow industry standards and proven patterns for production systems.
Common PitfallsAvoid premature optimization and over-engineering without clear requirements.
Further ReadingConsult official documentation and system design references for deeper dives.

Quick Reference

ConceptWhen to Use
Horizontal ScalingAdd more machines — works for stateless services
Vertical ScalingBigger machine — simpler, hits hardware limits
CachingReduce latency for frequently accessed data
Async ProcessingDecouple services, handle spikes gracefully

Implementation Tips

ItemDescription
Start SimpleBegin with minimal viable architecture, iterate based on real bottlenecks
Measure FirstProfile before optimizing — do not guess where the bottleneck is
Design for FailureAssume everything will fail — build redundancy and graceful degradation
Document DecisionsRecord architecture decisions (ADRs) with context and tradeoffs

Key Tradeoffs

TradeoffOption AOption B
Consistency vs AvailabilityStrong consistency (CP)High availability (AP)
Performance vs DurabilityIn-memory (fast, volatile)Disk-backed (slower, durable)
Simplicity vs FlexibilityMonolith (simple)Microservices (flexible)
Cost vs SpeedServerless (pay-per-use)Provisioned (faster, predictable)
Pro Tip: Start with a monolith and split when you have clear bounded contexts. Premature distribution creates complexity without the scale to justify it.