<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/scaling-postgresql-to-power-800-million-chatgpt-users-3mbfuagbd" -->

---
title: Scaling PostgreSQL to power 800 million ChatGPT users
description: OpenAI scaled PostgreSQL to handle millions of queries per second for 800 million ChatGPT users using a single primary Azure PostgreSQL instance with nearly 50...
canonical: https://daily.dev/posts/scaling-postgresql-to-power-800-million-chatgpt-users-3mbfuagbd
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Scaling PostgreSQL to power 800 million ChatGPT users | daily.dev
og:description: OpenAI scaled PostgreSQL to handle millions of queries per second for 800 million ChatGPT users using a single primary Azure PostgreSQL instance with nearly 50...
og:url: https://daily.dev/posts/scaling-postgresql-to-power-800-million-chatgpt-users-3mbfuagbd
og:image: https://api.daily.dev/og/posts/3MBFUAgbd.png
og:image:alt: Scaling PostgreSQL to power 800 million ChatGPT users
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Scaling PostgreSQL to power 800 million ChatGPT users

**[OpenAI](https://daily.dev/sources/openai)** · 12 min read · 297 upvotes · 11 comments

## Summary

OpenAI scaled PostgreSQL to handle millions of queries per second for 800 million ChatGPT users using a single primary Azure PostgreSQL instance with nearly 50 read replicas across multiple regions. Key optimizations included offloading reads to replicas, migrating write-heavy workloads to sharded systems like CosmosDB, implementing PgBouncer for connection pooling, deploying cache locking to prevent cache-miss storms, isolating workloads to prevent noisy neighbor issues, and enforcing strict rate limiting. The architecture achieved five-nines availability with low double-digit millisecond p99 latency despite PostgreSQL's MVCC limitations for write-heavy workloads.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://openai.com/index/scaling-postgresql/>

## Community discussion

Top comments from developers on daily.dev.

**@byteoutlaw** · 6 upvotes

> Woooow! Thanks, this was just what I needed to read!!! <3 Thanks to the asian team behind OpenAI! ;) - PG is absolutely insane!!!!!

**@kalandadev** · 3 upvotes

> My ChatGPT is still ver slow, please scale it more. Just kidding, thanks for the interesting insight 👏

**@singhxayush** · 3 upvotes

> Loved it! Great share. I have recently been exploring PSQL from scaling pov, this is a great insight to it.

**@raj247** · 2 upvotes

> This is an incredible deep dive. The sections on connection pooling with PgBouncer and the 'noisy neighbor' isolation really hit home. The way openai have managed to push a single-primary architecture to 10x load through rigorous MVCC tuning and caching locks is a masterclass in 'scaling vertically before over-complicating with shards.' It’s a great reminder that solid engineering often beats premature complexity. Thanks for sharing the hard-won lessons on WAL streaming—definitely something I'll be keeping in mind for my own infra projects!

**@gabrielbolarinwa** · 0 upvotes

> I don't think this is the only problem, the response speed isn't that bad scaling will make it better but the entire desktop app is a slideshow fr, you have to wait 5 mins for the app to startup, wait another 5 for the chat to fully switch, and sometimes by the time the chat is rendered, I would have sent a prompt and ChatGPT might have even responded but I won't even be able see it due to slow speed, fix the desktop app but until that ChatGPT isn't worth it, I'll just stick with Claude

## Similar posts on daily.dev

- [OpenAI Scales Single Primary Postgresql to Millions of Queries per Second for ChatGPT](https://daily.dev/posts/openai-scales-single-primary-postgresql-to-millions-of-queries-per-second-for-chatgpt-wcyldtady) · InfoQ · 31 upvotes · 0 comments
- [How OpenAI Scaled to 800 Million Users With Postgres](https://daily.dev/posts/how-openai-scaled-to-800-million-users-with-postgres-0qbtpoqpy) · ByteByteGo · 329 upvotes · 2 comments

---

Tags: [#database](https://daily.dev/tags/database), [#azure](https://daily.dev/tags/azure), [#postgresql](https://daily.dev/tags/postgresql), [#chatgpt](https://daily.dev/tags/chatgpt)

[View this post on daily.dev](https://daily.dev/posts/scaling-postgresql-to-power-800-million-chatgpt-users-3mbfuagbd)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Scaling PostgreSQL to power 800 million ChatGPT users","url":"https://daily.dev/posts/scaling-postgresql-to-power-800-million-chatgpt-users-3mbfuagbd","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/scaling-postgresql-to-power-800-million-chatgpt-users-3mbfuagbd"},"datePublished":"2026-01-22T19:40:06.217Z","dateModified":"2026-01-22T19:40:32.378Z","description":"OpenAI scaled PostgreSQL to handle millions of queries per second for 800 million ChatGPT users using a single primary Azure PostgreSQL instance with nearly 50...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a94c43267d9daf403a32b5d7e45b63e4?_a=AQAEulh","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a94c43267d9daf403a32b5d7e45b63e4?_a=AQAEulh","isAccessibleForFree":true,"articleSection":"OpenAI","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"OpenAI","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/984b3632316f4afaa3d5213d5c64fe65","url":"https://daily.dev/sources/openai"},"commentCount":11,"discussionUrl":"https://daily.dev/posts/scaling-postgresql-to-power-800-million-chatgpt-users-3mbfuagbd","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":297},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":11}],"keywords":"database,azure,postgresql,chatgpt","timeRequired":"PT12M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"OpenAI","item":"https://daily.dev/sources/openai"},{"@type":"ListItem","position":3,"name":"Scaling PostgreSQL to power 800 million ChatGPT users"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/scaling-postgresql-to-power-800-million-chatgpt-users-3mbfuagbd","comment":[{"@type":"Comment","text":"Woooow! Thanks, this was just what I needed to read!!! &lt;3 Thanks to the asian team behind OpenAI! ;) - PG is absolutely insane!!!","datePublished":"2026-01-24T14:34:42.647Z","url":"https://daily.dev/posts/3MBFUAgbd#c-YdA4OkMCL","author":{"@type":"Person","name":"Jacob B. Bonde","url":"https://daily.dev/byteoutlaw","image":"https://media.daily.dev/image/upload/s--veTChHK7--/f_auto/v1733220070/avatars/avatar_5cQvIZKr5tDFDotVDjulg"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":6}},{"@type":"Comment","text":"My ChatGPT is still ver slow, please scale it more. Just kidding, thanks for the interesting insight 👏","datePublished":"2026-01-27T01:26:50.372Z","url":"https://daily.dev/posts/3MBFUAgbd#c-jPxPdlISc","author":{"@type":"Person","name":"Tsotne Kalandadze","url":"https://daily.dev/kalandadev","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"Loved it! Great share. I have recently been exploring PSQL from scaling pov, this is a great insight to it.","datePublished":"2026-01-25T12:42:48.184Z","url":"https://daily.dev/posts/3MBFUAgbd#c-gi7I9Lapr","author":{"@type":"Person","name":"Ayush Kumar","url":"https://daily.dev/singhxayush","image":"https://media.daily.dev/image/upload/s--_-vyn46c--/f_auto/v1757707516/avatars/avatar_KqxKqcKxclxW6FQFAnVcJ?_a=BAMClqZW0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"This is an incredible deep dive. The sections on connection pooling with PgBouncer and the ‘noisy neighbor’ isolation really hit home. The way openai have managed to push a single-primary architecture to 10x load through rigorous MVCC tuning and caching locks is a masterclass in ‘scaling vertically before over-complicating with shards.’ It’s a great reminder that solid engineering often beats premature complexity. Thanks for sharing the hard-won lessons on WAL streaming—definitely something I’ll be keeping in mind for my own infra projects!","datePublished":"2026-02-07T05:25:37.097Z","dateModified":"2026-02-07T05:54:34.081Z","url":"https://daily.dev/posts/3MBFUAgbd#c-kYJW45dgR","author":{"@type":"Person","name":"Raj Dutta","url":"https://daily.dev/raj247","image":"https://avatars.githubusercontent.com/u/154328348?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"I don’t think this is the only problem, the response speed isn’t that bad scaling will make it better but the entire desktop app is a slideshow fr, you have to wait 5 mins for the app to startup, wait another 5 for the chat to fully switch, and sometimes by the time the chat is rendered, I would have sent a prompt and ChatGPT might have even responded but I won’t even be able see it due to slow speed, fix the desktop app but until that ChatGPT isn’t worth it, I’ll just stick with Claude","datePublished":"2026-03-06T09:45:02.792Z","url":"https://daily.dev/posts/3MBFUAgbd#c-YJtFkMw5A","author":{"@type":"Person","name":"Gabriel Bolarinwa","url":"https://daily.dev/gabrielbolarinwa","image":"https://lh3.googleusercontent.com/a/ACg8ocLUHOQbKp7ptrw-nZbpXVU1fZhAx2jeB2jA3iljktZ5BUboKiQ=s96-c"}}]}
```

