Cloudflare explains how D1's control plane runs millions of small databases
Cloudflare detailed how D1 keeps queries off central Postgres while supporting platforms that create a database per user, tenant or preview environment.
Cloudflare has published an engineering deep dive on how D1's control plane supports platforms with "millions of created databases, hundreds of thousands of which are active at any point." Its premise: AI-assisted development and vibe coding platforms push apps toward many small databases, one per user, tenant or preview environment. If you're choosing a backend for an agent-built app, this is a detailed look at that model. It is still one vendor describing its own system.
Cloudflare says each D1 database is backed by one SQLite Durable Object. Queries skip the central Postgres cluster: routing metadata lives in Workers KV, and Postgres, reached through Hyperdrive, handles create, delete and list operations. As of October 8, 2026, Cloudflare reports 15x growth in live databases over one year, 65x over two years, and 18x growth in daily active databases. In its example, wrangler d1 create finished in about 1.6 seconds. An independent walkthrough by Umesh Malik pulls out the reusable patterns, including a single Postgres "checkpoint" write that makes creation safe to retry and a 30-second heartbeat that repairs drift. He notes that heartbeat load grows with the number of active databases.
The D1 limits docs list the practical constraints:
- Workers Paid allows 1,000,000 databases per account. The first 100,000 are included, and each one after that costs $0.10 a month. The Free plan allows 10.
- Each database can hold up to 10 GB and processes queries one at a time.
- A 50 MB query result limit takes effect November 4, 2026.
The sources don't show how to run schema migrations across thousands of D1 databases at once. For a comparison, Dbggr's guide points to Neon for real Postgres with copy-on-write branching, and to D1, Turso or Durable Objects where an idle database costs only storage.
Sources
- Under the hood, off the hot path: how D1 scales to millions of databases · Cloudflare Blog
- Database per Tenant on Cloudflare D1: How to Build It at Scale · Umesh Malik
- D1 will enforce a maximum query result size of 50 MB · Changelog · Cloudflare
- Limits · Cloudflare D1 docs · Cloudflare
- Database per AI agent: Turso vs Neon vs Supabase vs Cloudflare D1 compared - Dbggr · Dbggr