When ChatGPT’s user count exploded, OpenAI’s PostgreSQL cluster found itself at the centre of a scale problem most teams will never see: supporting millions of queries per second for 800 million users, with a single-primary instance and nearly 50 global read replicas. This isn’t a story about sharding Postgres to the edge of reason—it’s about how far you can push a well-tuned, read-heavy Postgres setup before the wheels come off, and what actually breaks first.
Most of the pain came from sudden spikes: a cache-layer failure, a feature launch triggering a write storm, or an unexpected surge in expensive multi-way joins. These overloads caused query latency to rise, retries to pile on, and the whole system to spiral. The single-primary architecture wasn’t the weak point for reads—Postgres handled that, with replicas picking up the slack—but write spikes repeatedly pushed the system to the edge. MVCC’s habit of copying entire rows on update, and the resulting table and index bloat, made high write loads especially nasty.
What broke first: write spikes and MVCC pain
Every overload incident followed a similar path: something upstream failed, more database load landed on the primary, and as CPU and I/O climbed, queries slowed and retries kicked in. MVCC made matters worse—every update created new row versions, amplifying both writes and reads as the system scanned dead tuples. The result was write amplification, table and index bloat, and extra vacuuming headaches. For teams running Postgres without a dedicated DBA, these are exactly the pain points you’ll hit if your write volume spikes.
What OpenAI changed to keep scaling
- Read offloading: Replicas handled as much read traffic as possible. Reads that had to hit the primary (because they were part of write transactions) were aggressively optimized to avoid slow queries.
- Write minimisation: Anything shardable and write-heavy was migrated to sharded systems like Azure Cosmos DB. New tables are no longer added to the main Postgres cluster—future write-heavy workloads default to sharded stores.
- The team fixed bugs causing redundant writes, introduced lazy writes to smooth spikes, and enforced strict rate limits on things like backfills.




