Blog
News, insights and stories from the THUX team.
Cloudflare Redesigns D1 to Support Millions of Databases
Cloudflare explained how it redesigned D1’s control plane to scale to millions of databases, separating the query path from centralized management and relying on idempotency, retries, and eventual consistency.
Cloudflare described how it rethought the control plane of D1, its serverless SQL database built on SQLite, to support very rapid growth of the service. According to reports, over the past year the number of active databases each day increased 18-fold. To handle this scale, the company avoided concentrating all operational decisions in a single point: transactional metadata remains on Postgres, analytics runs through ClickHouse, and routing information is replicated globally via Workers KV. The core idea is to keep the query path away from central bottlenecks and leave the control layer the task of reconciling the system state.
From an architectural standpoint, the most interesting change is the clear separation between the data plane and the control plane. Queries are routed by a component at the network edge to the correct Durable Object, while authentication, authorization, rate limiting, and validation are handled earlier, without burdening every database access with redundant checks. Cloudflare also says it introduced distributed metadata caches, connection reuse, asynchronous flows, and periodic health checks. In practice, instead of pursuing immediate consistency at every step, the system is designed to tolerate small temporary misalignments and correct them later automatically.
This is where retries, idempotency, and eventual consistency come into play, three concepts that often remain theoretical until they have to be applied at scale. Cloudflare uses heartbeats every 30 seconds, with a per-database variation, to align each Durable Object with Postgres, which remains the authoritative source for database existence and account limits. This mechanism also helps repair creation or deletion operations that did not complete correctly: orphaned objects can be marked as deleted and routing data corrected if an update fails. Space limit enforcement follows a cautious logic as well: usage updates are queued and batched, so as to avoid write spikes on Postgres and costly scans on accounts with very high database counts.
For the THUX CODE audience, the value of the news is not in the individual product but in the method. When a system must coordinate millions of small, distributed resources, the temptation to centralize everything quickly leads to saturation, contention, and failures that are difficult to recover from. The D1 case instead shows a more useful approach for those designing cloud services or internal platforms: reduce dependencies in the critical path, accept asynchrony where it makes sense, and build self-healing mechanisms around a clear source of truth. It is a concrete reminder for anyone developing custom software: scalability often depends less on the single database and more on how the orchestration around it is designed.
Source: InfoQ, November 8, 2026