How OpenAI Kept Azure Cosmos DB Standing Under the Weight of 1 Billion ChatGPT Users

OpenAI engineers John Lee, Grach Hakobyan, and Chaoming Yu described how they rebuilt Habitat — the storage system that answers requests from more than a billion ChatGPT users across 40 regions in milliseconds. Habitat runs on Azure Cosmos DB, and the team had to change its approach to splitting the database across different products three separate times to avoid outages and improve performance. At first, all products shared a single database, which caused conflicts: one "noisy" client could hog all the throughput and take down login for everyone else. The team then moved to separate databases for each major product, which solved the noise problem but forced teams to manually plan capacity in advance — and feature launches regularly turned into emergency scaling meetings. Eventually, working with Microsoft, the team upgraded Cosmos DB itself — adding throttling for the "hottest" keys and request prioritization — and moved back to a single shared database that now balances load automatically. • OpenAI's largest Cosmos DB account stores tens of petabytes of data and handles more than 20 million requests per second — which OpenAI says is the largest publicly known use case for the service. • A power outage in one region in late 2024 revealed that failing over to a backup region took several hours — a failure at that scale had never been tested before. • OpenAI and Microsoft engineering teams now jointly monitor the system and have a direct communication channel for emergencies, bypassing standard support.

AI-processed from OpenAI Blog; edited by Hamidun News
How OpenAI Kept Azure Cosmos DB Standing Under the Weight of 1 Billion ChatGPT Users
Source: OpenAI Blog. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceOpenAI Blog ↗
Editor-in-Chief
Key metric #1A power outage in one region in late 2024 revealed that failing over to a backup region took several hours — a failure at that scale had never been tested before.
Key metric #2OpenAI and Microsoft engineering teams now jointly monitor the system and have a direct communication channel for emergencies, bypassing standard support.
Key metric #3Different products using semantically similar keys (like user_id) ended up sharing the same throughput limit, even though they had no logical reason to overlap.

Habitat: OpenAI's Internal Data Backbone

Habitat is OpenAI's internal storage platform, handling requests from ChatGPT, the API, Codex, and dozens of internal services. It needs to respond in milliseconds while serving more than a billion users worldwide, and it stores over 500 petabytes of data. The engine under the hood is Azure Cosmos DB. OpenAI engineers John Lee, Grach Hakobyan, and Chaoming Yu described how they rebuilt the way load gets distributed across products inside this database — three times — before landing on a scheme that actually worked.

The Shared Database Problem and "Noisy Neighbors"

Originally, every product wrote to a single shared Cosmos DB database (container). Each key — a user ID, for example — has a limit of 10,000 operations per second, but in practice that limit applies not to the key itself, but to the physical disk partition where the key happens to be stored alongside other keys. That created two problems:

  • Different products using semantically similar keys (like user_id) ended up sharing the same throughput limit, even though they had no logical reason to overlap.
  • If one client suddenly spiked load on "its" partition, every other user and feature whose data happened to sit nearby suffered — sometimes to the point of login failures across the board.

A secondary issue surfaced too: "weak partitions." When a disk partition grew large enough that Cosmos DB split it in two, the throughput of each half was cut in proportion — meaning data growth alone could slow things down, even if request volume stayed flat.

Isolation Through Separate Databases — and Its Cost

The fix was to spin up a separate database for every major new product or feature. That genuinely eliminated the noisy-neighbor effect — one service overloading no longer dragged down the rest. But the approach had a downside:

  • Product teams had to request the right throughput ahead of launch themselves — and often forgot, turning launches into last-minute emergency scaling meetings.
  • Load that would have been a rounding error in a shared database — going from 1,000 to a million requests per second is just 5% of total shared capacity — could blow past a dedicated database's provisioned resources by a thousandfold.
  • Capacity planning became scattered across the entire company instead of living with one central team, and the quality of that planning varied wildly from team to team.

Back to a Shared Database — This Time With Smart Balancing

Realizing that neither approach scaled organizationally, the Habitat team worked with Microsoft engineers to rework the mechanics of Cosmos DB itself:

  • They added throttling that targets the "hottest" keys first, so one aggressive client can't claim an entire partition's throughput.
  • They introduced request prioritization (QoS): background jobs like bulk data exports now get throttled first, while interactive user requests are the last to be cut.
  • Together with Azure, they improved Cosmos DB's serverless mode, raising the per-partition limit from 5,000 to 10,000 operations per second and adding automatic splitting based on load rather than just data volume.

This let the team return to a single shared database without manual capacity planning — and according to the authors, there hasn't been a single outage caused by overload or noisy neighbors in the months since the switch.

Joint Engineering With Microsoft

OpenAI's largest Cosmos DB account stores tens of petabytes and handles more than 20 million requests per second — the authors call it the largest deployment of the service they're aware of. At that scale, standard cloud-provider support stops being enough: a power outage in one region in late 2024 showed that failing over to a backup region for an account that size takes several hours — a failure of that magnitude had never been tested before. A month later, the reverse cutover caused a second incident: clients rushed to reconnect to the original region en masse and overwhelmed its gateway, even though only part of the data had actually come back online.

After these incidents, OpenAI and Azure built out direct collaboration: shared dashboards, joint testing against a copy of the production account, direct Teams channels, and the ability to page each other directly, bypassing standard support. Over the past year, the teams have jointly improved the scalability of the Cosmos DB gateway, added metadata caching, reduced the number of connections from Habitat's Python services, and separated critical and background workloads onto different networks.

The main takeaway for engineering teams: multi-tenant (shared) systems are cheaper and simpler to operate, but they require built-in isolation mechanisms from the provider itself — without them, the only alternative is manually splitting into separate databases, which just shifts the capacity-planning burden onto dozens of teams.

Story

Key Questions Answered

What are the key details on Habitat: OpenAI's Internal Data Backbone?

Habitat is OpenAI's internal storage platform, handling requests from ChatGPT, the API, Codex, and dozens of internal services. It needs to respond in milliseconds while serving more than a billion users worldwide, and it stores over 500 petabytes of data. The engine under the hood is Azure Cosmos DB. OpenAI engineers John Lee, Grach Hakobyan, and Chaoming Yu described how they rebuilt the way load gets distributed across products inside this database — three times — before landing on a scheme that actually worked.

What are the key details on The Shared Database Problem and "Noisy Neighbors"?

Originally, every product wrote to a single shared Cosmos DB database (container). Each key — a user ID, for example — has a limit of 10,000 operations per second, but in practice that limit applies not to the key itself, but to the physical disk partition where the key happens to be stored alongside other keys. That created two problems: Different products using semantically similar keys (like user_id) ended up sharing the same throughput limit, even though they had no logical reason to overlap. If one client suddenly spiked load on "its" partition, every other user and fe

What are the key details on Isolation Through Separate Databases — and Its Cost?

The fix was to spin up a separate database for every major new product or feature. That genuinely eliminated the noisy-neighbor effect — one service overloading no longer dragged down the rest. But the approach had a downside: Product teams had to request the right throughput ahead of launch themselves — and often forgot, turning launches into last-minute emergency scaling meetings. Load that would have been a rounding error in a shared database — going from 1,000 to a million requests per second is just 5% of total shared capacity — could blow past a dedicated database's p

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Private AI Builders Community · Vibe Club

Ship AI Faster with Founders, Engineers & Weekly Architecture Reviews

Inside Vibe Club (hamidun.com/club) — weekly live masterminds with Zhemal Khamidun, Tech Radar, full LMS access, and 370+ production Claude Code skills.

Join Vibe Club →Explore Hamidun Academy
What do you think?
Loading comments…