OpenAI explains how PostgreSQL powers ChatGPT for 800 million users via a single primary Azure PostgreSQL instance with nearly 50 global read replicas, covering optimizations, challenges with write-heavy workloads, and lessons learned at scale.
Highlights
A single primary Azure PostgreSQL flexible server with nearly 50 read replicas across multiple global regions supports millions of queries per second
PostgreSQL load at OpenAI grew more than 10x over the past year
Read-heavy scaling relies on caching layers, multi-layer rate limiting, query routing, and application-level optimizations
Write-heavy workloads are shifted to sharded systems such as Azure CosmosDB because PostgreSQL's MVCC is less efficient for writes
The architecture achieves low double-digit millisecond latency and five-nines availability with only one major incident in the past year
auto-generated
via OpenAI
Context
Audience
Database engineers, infrastructure engineers, SREs, and architects working with PostgreSQL or relational databases at scale
Azure PostgreSQL Flexible ServerAzure CosmosDBPostgreSQL MVCCRead Replica ArchitecturesDatabase ShardingHigh-Availability Systems
Discover Similar Content
hatchet.run
Hatchet
A guide to preventing Postgres from toppling over.
planetscale.com
Making 768 servers look like 1 — PlanetScale
How to make 768 distinct Postgres servers look like 1 to your applications.
malisper.me
Rebuilding Postgres for 300x faster analytics: batching, operator fusion, and SIMD - malisper.me
Last week we released version 0.2 of pgrust. This release was all about performance. It’s 10x faster than the previous version of pgrust. On OLTP benc...