<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-openai-scaled-to-800-million-users-with-postgres-0qbtpoqpy" -->

---
title: How OpenAI Scaled to 800 Million Users With Postgres
description: OpenAI scaled PostgreSQL to handle millions of queries per second for 800 million ChatGPT users using a single-primary architecture with read replicas. Their...
canonical: https://daily.dev/posts/how-openai-scaled-to-800-million-users-with-postgres-0qbtpoqpy
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How OpenAI Scaled to 800 Million Users With Postgres | daily.dev
og:description: OpenAI scaled PostgreSQL to handle millions of queries per second for 800 million ChatGPT users using a single-primary architecture with read replicas. Their...
og:url: https://daily.dev/posts/how-openai-scaled-to-800-million-users-with-postgres-0qbtpoqpy
og:image: https://api.daily.dev/og/posts/0QBTpoQPy.png
og:image:alt: How OpenAI Scaled to 800 Million Users With Postgres
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.

# How OpenAI Scaled to 800 Million Users With Postgres

**[ByteByteGo](https://daily.dev/sources/bytebytego)** · 11 min read · 329 upvotes · 2 comments

## Summary

OpenAI scaled PostgreSQL to handle millions of queries per second for 800 million ChatGPT users using a single-primary architecture with read replicas. Their approach focused on three pillars: minimizing primary database load through read offloading and write optimization, query and connection optimization using PgBouncer for connection pooling, and preventing cascading failures with cache locking and rate limiting. They addressed PostgreSQL's MVCC constraints by migrating write-heavy workloads to sharded systems and enforcing strict schema change rules. The system achieves five-nines availability with low double-digit millisecond p99 latency through systematic optimization rather than sharding.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.bytebytego.com/p/how-openai-scaled-to-800-million>

## Community discussion

Top comments from developers on daily.dev.

**@dhruvrana69** · 0 upvotes

> Thank you so much for sharing this.

**@julenlizaso** · 0 upvotes

> Dedicated to all those people who say that Postgres is not eligible for production

## 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
- [Scaling PostgreSQL to power 800 million ChatGPT users](https://daily.dev/posts/scaling-postgresql-to-power-800-million-chatgpt-users-3mbfuagbd) · OpenAI · 297 upvotes · 11 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/how-openai-scaled-to-800-million-users-with-postgres-0qbtpoqpy)

```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":"How OpenAI Scaled to 800 Million Users With Postgres","url":"https://daily.dev/posts/how-openai-scaled-to-800-million-users-with-postgres-0qbtpoqpy","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-openai-scaled-to-800-million-users-with-postgres-0qbtpoqpy"},"datePublished":"2026-02-16T16:37:49.638Z","dateModified":"2026-02-16T20:53:09.804Z","description":"OpenAI scaled PostgreSQL to handle millions of queries per second for 800 million ChatGPT users using a single-primary architecture with read replicas. Their...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8fa2c39b543f4fcea17491f290c5723d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8fa2c39b543f4fcea17491f290c5723d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"ByteByteGo","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":"ByteByteGo","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/35be29234ee14d01a9cd049c52e12753","url":"https://daily.dev/sources/bytebytego"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/how-openai-scaled-to-800-million-users-with-postgres-0qbtpoqpy","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":329},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"database,openai,postgresql","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"ByteByteGo","item":"https://daily.dev/sources/bytebytego"},{"@type":"ListItem","position":3,"name":"How OpenAI Scaled to 800 Million Users With Postgres"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/how-openai-scaled-to-800-million-users-with-postgres-0qbtpoqpy","comment":[{"@type":"Comment","text":"Thank you so much for sharing this.","datePublished":"2026-02-25T15:06:12.477Z","url":"https://daily.dev/posts/0QBTpoQPy#c-HnHgrDYbi","author":{"@type":"Person","name":"Dhruv Rana","url":"https://daily.dev/dhruvrana69","image":"https://lh3.googleusercontent.com/a/ACg8ocJV17XVtXpgGUnBT58aj8Ts1hRYCY0O3vjKhj3PRygqtQVMjfel=s96-c"}},{"@type":"Comment","text":"Dedicated to all those people who say that Postgres is not eligible for production","datePublished":"2026-03-10T06:30:28.190Z","url":"https://daily.dev/posts/0QBTpoQPy#c-oR3xY1f9o","author":{"@type":"Person","name":"Julen Lizaso","url":"https://daily.dev/julenlizaso","image":"https://lh3.googleusercontent.com/a/ACg8ocIv8mXQ0nq8sZjLZ9Hxekc_oZjOH18xj2X3qa3CtFRnT935B_OU=s96-c"}}]}
```

