Scaling PostgreSQL to Power 800 Million ChatGPT Users

Source: https://openai.com/index/scaling-postgresql/ Author: OpenAI Date: 2026-01-26

Summary

OpenAI’s engineering post on how they scaled PostgreSQL to handle millions of queries per second for ChatGPT’s 800 million users. Notable as a case study in extreme database scaling with a conventional (non-distributed) database.

Key Claims

  • PostgreSQL at 800M users: OpenAI kept PostgreSQL as the primary database, adding read replicas, connection pooling (PgBouncer), and caching layers (Redis) rather than moving to distributed systems.
  • PgBouncer insight: connection overhead at scale is significant — a 1000-node PostgreSQL cluster without pooling would spend most time on connection management.
  • Sharding approach: logical sharding by user ID — each shard is a separate PostgreSQL instance. No distributed transactions needed because user data is self-contained.
  • Lesson: resist the urge to adopt distributed databases prematurely. Vertical scaling + proper configuration handles more than expected.
  • Read replicas: 90%+ of reads go to replicas; primary is write-only. This asymmetry enables linear read scaling.

Entities

Concepts

  • Infrastructure engineering essay; relevant as context for AI company operations at scale