In most scaling applications, the database is the first system to break under load. As concurrent users multiply, connections spike, queries queue, pools exhaust, and whole web services lock up.
Amazon Aurora PostgreSQL is the gold standard for relational SaaS workloads, but it needs deliberate engineering to handle millions of queries without degradation. Here is the 3 Dices Technology scaling blueprint.
RDS Proxy and connection pooling
PostgreSQL uses a process-per-connection model, so creating and tearing down connections for serverless functions like AWS Lambda rapidly consumes CPU and memory. We place Amazon RDS Proxy in front of Aurora:
- Multiplexing: shares and reuses database connections across thousands of concurrent microservices.
- Transparent failover: in an AZ outage, RDS Proxy shifts traffic to an Aurora read replica in under three seconds without dropping active transactions.
Read/write splitting with read replicas
Most SaaS workloads are about 85% reads and 15% writes. We configure Aurora Auto Scaling with read replicas across multiple Availability Zones. Application ORMs use dual connection pools: writes target the cluster (writer) endpoint, while heavy dashboard and analytics queries target the Aurora reader endpoint.
Advanced indexing and query optimization
A missing index turns an instant 5ms query into a 45-second table scan that exhausts database I/O. We run continuous performance monitoring with AWS Performance Insights:
- Partial and composite indexes: indexing only active records (for example WHERE status = 'active') to keep index sizes small enough to cache entirely in RAM.
- Partitioning: range-partitioning multi-million-row event and audit tables by month, for fast index searches and zero-cost data drops.
Optimized versus unoptimized
Typical production database metrics, before and after:
- Max concurrent connections: from roughly 200–500 to 10,000+ via RDS Proxy.
- Failover recovery time: from 60–120 seconds of downtime to sub-3-second seamless failover.
- Read query latency (P95): from 180–450ms under load to 8–15ms via auto-scaled replicas.
- Storage scaling: from manual volume expansion with downtime to automatic serverless scaling up to 128 TiB.
- Backup overhead: from performance impact during snapshots to continuous distributed backup with no measurable impact.
Prevent the outage before launch
Our AWS architecture and FinOps work optimizes, scales, and manages relational databases on AWS so they hold up on launch day.
About the author
Deep Mehta
Deep is the founder of 3 Dices Technology, a cloud engineering studio shipping AWS architecture, DevOps automation, and production AI systems for startups and SMBs.
Connect on LinkedIn