Menu

1 / 2

OpenAI scales PostgreSQL for 800 million users with a single writer (no sharding)

DEV Community·Fernando Rodriguez·6 months ago
#AbGri8Sb
Reading 0:00
15s threshold

Every time an article comes out about a large company's infrastructure, half the Hacker News comments are variations of "of course they use Kubernetes with 47 microservices and a distributed database with custom consensus protocol." And when it turns out they don't—that they use plain PostgreSQL with a single primary and discipline—there's an uncomfortable silence.

That just happened with OpenAI.

The numbers nobody expected

Bohan Zhang, infrastructure engineer at OpenAI, published details about how they scale PostgreSQL for ChatGPT. The numbers:

800 million users

A single PostgreSQL *primary * (writer) on Azure

~50 *read replicas *

Millions of queries per second

p99 of 10-19ms

99.999% availability

One SEV-0 in a year (and that was from ImageGen's viral launch, which added 100 million new users in a week)

Read that again. One. Single. Writer. For 800 million users.

"But they should shard"

No.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.