✓ Database uptime lifted to 99.99% (four nines)
✓ p95 query time down 45% (620ms → 340ms)
✓ DR failover cut from ~45 minutes to ~90 seconds
Before → after
| Metric | Before | After |
|---|---|---|
| Database uptime | 99.82% | 99.99% |
| p95 query time | 620ms | 340ms |
| Failover time (DR test) | ~45 min | ~90 sec |
A fintech marketplace ran its production database on a single, self-managed Postgres box. When it went down, and it did, the whole platform went down with it.
The challenge
- No replication, no failover, no tested backups.
- Slow queries from missing indexes and a bloated schema.
- Over-permissioned access with no audit trail.
- “We’ll fix the DB when it breaks” had become the unofficial plan.
What we built
- Cloud SQL migration moved to managed Postgres with high availability and automatic failover.
- Query tuning profiled slow queries, added indexes, and denormalized hot paths, cutting p95 latency almost in half.
- IAM hardening scoped access with least-privilege roles, service accounts, and audit logging.
- Backups & DR automated point-in-time recovery and ran failover drills until they were routine.
- Monitoring wired query insights, uptime checks, and alerting with runbooks.
The results
Uptime climbed to 99.99%, p95 query time dropped 45%, and a tested failover now completes in about 90 seconds instead of 45 anxious minutes. The platform hasn’t had a database-driven outage since.
The takeaway
The database is the one thing you can’t improvise. Managed SQL, least-privilege IAM, and rehearsed recovery turn a single point of failure into a non-event.
Stack Cloud SQLPostgreSQLCloud IAMCloud MonitoringTerraform