Database Cost Engineering: Rules of Thumb
Database costs sneak up. Five rules of thumb cap them without sacrificing performance.
Why DB costs sneak
Storage grows; instance class drifts up; backups accumulate; replicas pile on.
Without active management, DB cost compounds.
Five rules of thumb
- 1. Right-size instance class quarterly.
- 2. Tier old data to cheaper storage.
- 3. Prune unused indexes.
- 4. Cap backup retention.
- 5. Audit replicas for actual usage.
Per-rule savings
Right-size: 20-40%.
Tier old data: 50-80% on archived data.
Index prune: 5-15% storage + write speedup.
Backup retention: 30-50% of backup spend.
Replica audit: 10-30% replica spend.
Order of operations
Order: right-size first (highest impact). Then archive. Then index. Backups + replicas last.
Apply quarterly; the cumulative effect is large.
Antipatterns
- Database growth as inevitable. Mostly preventable.
- One-time cost cut. Drift returns.
- Cost vs performance as binary. Most fixes do both.
What to do this week
Three moves. (1) Apply this pattern to your most-loaded table. (2) Measure query latency / write throughput before/after. (3) Document the win and the constraint so the next refactor inherits the knowledge.