Перейти к содержимому

Why More Database Copies Don't Scale Writes (ChatGPT's Postgres, Explained)

Whiteboard Bytes

0:00 / 0:00

Why More Database Copies Don't Scale Writes (ChatGPT's Postgres, Explained)

1 просмотр · 3 дн. назад
Whiteboard Bytes
11 подписчиков
1 просмотр · 3 дн. назад
In January 2026 OpenAI described one PostgreSQL deployment behind ChatGPT: one primary and nearly 50 read replicas. Follow a made-up chat rename from 'Untitled' to 'Goa trip': a read goes to a replica and back, a write goes only to the primary, the write-ahead log streams to every replica, and replication lag shows the old name. Then double the replicas and watch reads split while every replica still replays every write, see how OpenAI guarded its one writer, and learn why sharding is what splits writes. OpenAI facts are as of 22 Jan 2026 and describe one workload, not all of ChatGPT. The chat app, lag timings and traffic numbers are illustrative teaching examples, not OpenAI measurements. Chapters: 0:00 The rename that came back 0:45 OpenAI's one-writer setup (2026) 1:33 Primary, replicas, read and write 3:31 Lag on a timeline 4:21 One fix: read your own writes 4:41 Doubling the replicas 5:39 Your turn 6:24 Guarding the one writer 7:34 Sharding: splitting the writes 8:52 Recap In-video check: you have 50 replicas, and next month reads and writes both double. You add 50 more replicas. What does that fix, and what gets worse? The answer is in the video. Sources: OpenAI, 'Scaling PostgreSQL to power 800 million ChatGPT users', Bohan Zhang, 22 Jan 2026: https://openai.com/index/scaling-post... PostgreSQL docs, log-shipping standby servers: https://www.postgresql.org/docs/curre... PostgreSQL docs, hot standby: https://www.postgresql.org/docs/curre... PostgreSQL docs, write-ahead logging: https://www.postgresql.org/docs/curre... PostgreSQL docs, WAL settings (synchronous_commit): https://www.postgresql.org/docs/curre... PostgreSQL docs, establishing connections: https://www.postgresql.org/docs/curre... Azure Database for PostgreSQL read replicas: https://learn.microsoft.com/en-us/azu... Azure Cosmos DB partitioning: https://learn.microsoft.com/en-us/azu... Instagram: @whiteboardbytes #systemdesign #postgresql #databases