Under the hood, off the hot path: how D1 scales to millions of databases
9 similar posts
- Cloudflare D1
- SQLite
- Workers KV
- Hyperdrive
- Postgres
- Durable Objects
- ClickHouse
AI Summary
Cloudflare explains how they scaled D1, their serverless SQLite database, to support millions of databases by decoupling the control plane from the data plane. The architecture uses Workers KV for critical routing metadata, Hyperdrive and Postgres read replicas for efficient routing and connection pooling, and Durable Objects to back each individual SQLite database near the user.
Key Takeaways
- D1 uses one SQLite Durable Object per database, enabling millions of isolated instances.
- Workers KV serves as a globally distributed datastore for routing metadata, keeping central Postgres out of the data plane.
- Periodic heartbeats handle self-correction and cleanup of orphaned Durable Objects.
Why it matters
As modern application patterns shift toward multi-tenant architectures, preview environments, and per-user databases driven by AI agents, scaling database control planes without creating centralized bottlenecks is a vital engineering challenge.
Conversation0
What would you add from your experience?
Checking your session…
Every good conversation starts with one perspective.