Postgres at 800M Users Without Sharding — and the Patterns You Should Steal Today
Two Production Playbooks for Scaling Postgres
Two of the highest-signal reports today detail production-proven PostgreSQL scaling patterns from OpenAI and Netflix — and they're complementary. OpenAI scaled a single-primary Postgres instance to serve 800 million ChatGPT users at millions of QPS with 99.999% uptime, while Netflix migrated 400 RDS PostgreSQL clusters to Aurora using WAL-streaming replica promotion for near-zero-downtime cutover.
OpenAI's Defense-in-Depth Architecture
OpenAI runs a single primary writer on Azure PostgreSQL streaming WAL to ~50 read replicas. Each replica has its own Kubernetes deployment running multiple PgBouncer pods behind a K8s Service. The results: connection latency dropped from 50ms to 5ms (10x improvement), and their only SEV-0 in 12 months came during the ImageGen viral launch when 100M users signed up in a week.
The protection stack is what makes this work:
| Layer | Mechanism | What It Prevents |
|---|---|---|
| Connection | PgBouncer (transaction pooling) | Connection storms; 50ms→5ms latency |
| Cache | Lease/locking on cache miss | Thundering herd — one request hits Postgres per key |
| Query | ORM-level rate limiting + kill switch | Expensive queries (their 12-table join caused multiple SEVs) |
| Write | Write-heavy workloads → Cosmos DB | Write storms on single primary |
| Schema | 5-second DDL timeout; concurrent-only indexes | Lock contention from migrations |
They explicitly rejected sharding — estimated at months-to-years of effort modifying hundreds of endpoints. This only works because their workload is overwhelmingly reads. At ~50 replicas, they're hitting WAL fan-out limits and collaborating with Azure on cascading replication, which is still in testing due to complex failover semantics.
Netflix's WAL-Streaming Migration Pattern
Netflix's approach is elegantly simple: create an Aurora read replica of the RDS instance, let it catch up via continuous WAL streaming, validate replication lag, then promote. No AWS DMS, no CDC middleware, no replication slot management. The entire workflow was built as self-service and credential-free — individual teams triggered their own migrations.
Complementary Tooling: sql-tap and Guidewire's Snapshot Optimization
Two additional data points strengthen the Postgres scaling story. sql-tap is a new transparent SQL proxy that captures queries, transactions, timings, and EXPLAIN output without code changes — just redirect your connection string. And Guidewire cut Debezium CDC snapshot time from 68.5 to 20 hours on a 7TB database by combining Aurora Copy-on-Write cloning with Timefold constraint-based partitioning for intelligent worker distribution.
The real lesson isn't 'don't shard' — it's that the protection layers around your database matter more than the database topology itself.
What to do
Deploy PgBouncer in transaction pooling mode on any Postgres instance running without a connection pooler — this week
Profile your top 10 most expensive queries and identify any multi-table joins that could move to the application layer — this sprint
Implement cache lease/locking on your hottest read paths by end of quarter
If planning RDS→Aurora migration, prototype Netflix's WAL-streaming replica promotion pattern on a non-critical cluster before reaching for DMS