Database Size Growth Projection
What you'll learn: How to predict how much disk space your database will need weeks, months, or years from now.
The Core Idea
When designing a system, you can't just think about today's storage needs—you must project how large your database will grow over time. This prevents nasty surprises like running out of disk space or suddenly needing expensive migrations.
The basic formula is straightforward:
Total Size = (writes per day) × (average record size) × (days retained)
Breaking It Down
Imagine you're building a social media app where users post messages:
- Writes per day: 10 million new posts daily
- Average record size: 500 bytes per post (text + metadata)
- Retention policy: Keep posts for 5 years (1,825 days)
Your calculation:
- Daily growth: 10M × 500 bytes = 5 GB/day
- Total after 5 years: 5 GB × 1,825 days ≈ 9,125 GB ≈ 9 TB
Don't Forget Growth
Real systems grow! If user activity increases 20% yearly, your calculations compound:
- Year 1: ~1.8 TB
- Year 2: ~2.2 TB (20% more daily writes)
- Year 3: ~2.6 TB
- And so on...
Why Retention Policies Matter
If you deleted posts older than 1 year instead of keeping them forever, you'd only need about 1.8 TB instead of 9 TB—a massive difference! Retention policies directly cap your storage growth.
Key Takeaway: Database size projection multiplies daily writes by record size and retention period, helping you plan storage capacity and costs before building your system.