MikhbarMIKHBAR
Web

Cloudflare Details How D1 Scales to Millions of Databases

Cloudflare has detailed the architectural evolution of D1, its serverless SQLite database, showcasing how the platform scales to support millions of databases while keeping query operations decentralized at the edge.

Cloudflare Details How D1 Scales to Millions of Databases

Scaling the Serverless Database Model

Traditional database architecture typically relies on one or two large database clusters per application, usually managed alongside a connection pooling solution. However, AI-assisted development and vibe coding platforms are shifting this model toward a paradigm of many small databases—often allocating one database per user, application, preview environment, or tenant. This emerging architectural shift aligns closely with D1, Cloudflare's managed, serverless database based on SQLite, which enables developers to spin up millions of databases while paying only for actual resource utilization.

As adoption expanded, Cloudflare faced a core architectural challenge: scaling the control plane to accommodate millions of databases without introducing centralized bottlenecks that could slow down query performance. To meet this demand, the engineering team implemented extensive structural updates. As of October 8, 2026, D1 has crossed the milestone of 5.5 million databases, achieving a 15x growth in live non-deleted databases and a 65x increase over a two-year period.

Under the hood, off the hot path: how D1 scales to millions of databases
Image related to the report from Cloudflare Blog · Source: Cloudflare Blog

Active Growth and Real-World Usage

In addition to total database creation, Cloudflare recorded an 18x growth in daily active databases over the preceding year, defined as any database that executed at least one query during that calendar day. Established platforms are leveraging these capabilities within the Cloudflare ecosystem. For example, platforms like ChatGPT Sites utilize D1 to give users a straightforward, scalable way to integrate features such as custom metrics, leaderboards, and comments into interactive dashboards, games, and developer tools.

To guide ongoing optimizations during development, the team periodically conducted load testing well above projected growth targets. This rigorous testing helped pinpoint bottlenecks and shaped the overarching design principles used for building reliable control and data planes on the platform.

Cloudflare Details How D1 Scales to Millions of Databases
Image related to the report from Cloudflare Blog · Source: Cloudflare Blog

Core Architectural Tenets and Routing

Cloudflare established several governing tenets for building out the D1 control plane. These principles include designing all system processes with failure and idempotency in mind, avoiding single-region centralized components in any hot path for data plane query requests, and relying on distributed infrastructure for performance.

To achieve low-latency routing, the platform uses Workers KV as a globally distributed key-value store for critical routing metadata, ensuring that cache misses rarely force queries back to central databases. Additionally, the system uses Hyperdrive to access central Postgres databases, providing efficient connection pooling and optimized routing and caching against read replicas.

Cloudflare Details How D1 Scales to Millions of Databases
Image related to the report from Cloudflare Blog · Source: Cloudflare Blog

System Components and Execution Planes

Under the hood, each individual D1 database is backed by one SQLite Durable Object, which facilitates the creation of millions of instances. The architecture cleanly separates operations into distinct categories: the data plane handles all database query requests as fast as possible at the edge; the control plane manages HTTP API operations and non-query user flows; and the background asynchronous plane processes analytical and billing workflows using eventual consistency.

Users can execute queries either through HTTP API query endpoints or via a deployed Worker utilizing a D1 Worker binding. These bindings route requests directly to the D1 Eyeball Worker, which proxies the interaction to the specific Durable Object backing the target database.

Cloudflare Details How D1 Scales to Millions of Databases
Image related to the report from Cloudflare Blog · Source: Cloudflare Blog

Sources

  • Cloudflare BlogUnder the hood, off the hot path: how D1 scales to millions of databases

Continue chronologically

Related entity coverage