The Foundation of OpenAI's Data Infrastructure
As ChatGPT usage continues to surge, the backbone of OpenAI’s data operations—a platform known as Habitat—has undergone a massive transformation. Currently, Habitat manages over 500 petabytes of data, facilitating more than 70 million requests every second. Serving over 1 billion users weekly across 40 geographic regions, Habitat acts as the critical intermediary between OpenAI’s diverse product suite and underlying storage resources like Azure Cosmos DB.
Originally conceived in mid-2024, Habitat began its life as a modest Python library. Its primary purpose was to abstract database management away from product engineers, allowing teams to store and retrieve information without needing to navigate the complexities of schema lookups, encryption, authorization, and data residency requirements. By providing a unified interface, it enabled rapid feature development while ensuring that critical data security and privacy protocols were enforced consistently across the company.
The Transition to a Centralized Service
By mid-2025, the limitations of a client-side library model became apparent. As the volume of OpenAI’s services ballooned, coordinating updates across dozens of disparate systems turned into a logistical bottleneck. Implementing cross-cutting changes, such as regional routing for data residency or new security features, required complex, multi-day rollouts that were prone to operational failures and human error. If a single team rolled back a service, it could jeopardize the stability of the entire storage layer.
To solve this, OpenAI transitioned Habitat from a client-side library into a centralized, standalone service. This architectural shift provided a single point of control for deployments and observability. By decoupling the storage logic, the infrastructure team could implement platform-wide improvements—such as refined rate limiting and centralized audit logging—without requiring individual product teams to manage updates. This consolidation has proven vital for maintaining data security and protecting user information from both internal and external actors.
Navigating the Python Scale Challenge
Opting to keep Habitat written in Python during this massive scaling phase was a calculated decision. While the team acknowledged that Python’s performance limitations in high-throughput scenarios made an eventual migration to a more efficient language like Rust inevitable, the immediate goal was to unblock developers and stabilize the platform. The engineers leveraged OpenAI's own internal coding models to bridge the gap, betting that AI-assisted code generation would eventually simplify the transition away from Python.
Operating a Python-based service at this scale introduced unique hurdles, particularly concerning request latency. In an environment where a single user interaction might trigger hundreds of database lookups, tail latency becomes the primary enemy of user experience. The team discovered that their biggest bottleneck was the asyncio event loop. Because Python’s global interpreter lock (GIL) prevents true CPU parallelism for execution, CPU-heavy tasks like encryption, compression, and request routing caused significant scheduling delays. To mitigate this, OpenAI implemented granular monitoring of the asyncio loop, opting to limit the number of concurrent requests per worker process while scaling out the number of processes horizontally to maintain performance.
Why It Matters
- Operational Efficiency: Shifting to a centralized service model eliminated the need for fragmented deployments, significantly reducing the blast radius of potential outages.
- Performance at Scale: By treating infrastructure as code and using AI to manage technical debt, OpenAI has sustained 10x year-over-year growth for three consecutive years.
- Data Security: Centralizing the storage layer acts as a critical security chokepoint, ensuring that access control, rate limiting, and encryption are applied consistently across all product lines.











