Scaling PostgreSQL to Millions of Queries Per Second: Lessons from OpenAI
rajkumarsamra.me·4d·
Discuss: r/programming
🏗️Search Infrastructure
Preview
Report Post

Scaling PostgreSQL to Millions of Queries Per Second: Lessons from OpenAI

When OpenAI’s ChatGPT launched, traffic exploded at an unprecedented rate. Their PostgreSQL database faced a challenge that would make most database engineers break into a cold sweat: scaling a single-primary PostgreSQL setup to handle 800 million users and millions of queries per second.

The conventional wisdom says you can’t scale PostgreSQL this way. You need sharding, you need distributed systems, you need to abandon the single-primary architecture. But OpenAI proved that wrong.

They scaled PostgreSQL to millions of QPS with a single primary and nearly 50 read replicas, maintaining low double-digit millisecond p99 latency and five-nines availability. Over the past year, their PostgreSQL load g…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help