Skip to content
Minute Campus.

How real companies do itLesson 061 min

How does ChatGPT serve 800 million users from one main database?

OpenAI described in January 2026 how ChatGPT's PostgreSQL setup works. One main server, the primary, accepts every write, such as a new chat. Most work is reading, so nearly fifty copies, called read replicas, spread across regions handle those requests. Every change on the primary is passed to each copy. The costs: a copy can be a moment behind, and one primary has a ceiling for writes.

Remember

Before you scale an app, find out whether it mostly reads or mostly writes.

Sources

Checked at the source.

Every claim in the lesson was checked against these before it was recorded.

  1. 1Scaling PostgreSQL to power 800 million ChatGPT usersBohan Zhang · OpenAI · 22 Jan 2026 · read 4 Oct 2026One primary instance serving all writes, nearly 50 read replicas, and write-heavy workloads moved to sharded systems.

Transcript

The lesson, word for word.

Read it at your own pace, or search the page for a term.

ChatGPT has eight hundred million users, and one main database takes every write. OpenAI explained it in January twenty twenty-six. The database is PostgreSQL. One server, called the primary, accepts every change: a new chat, a renamed conversation. But most of the work is not changes. It is reading: loading your chats, checking your account. So the primary keeps nearly fifty copies of itself, called read replicas, in different regions. Every change made on the primary is passed along to each copy. Your reads go to a copy. Only your writes go to the primary. That spreads the reading across many machines. There is a cost. A copy can be a moment behind. And one primary has a ceiling for writes, so OpenAI moves its write-heavy data to other systems. The lesson: find out whether your app mostly reads or mostly writes before you scale it.

Questions? Comment on the lesson on YouTube

New lessons every day.

Follow Minute Campus where you already scroll.