
Cloudflare D1
FreemiumServerless SQLite, native to the Cloudflare edge.
Published 27 September 2026
Scores
Popularity3/5
Widely visible through Cloudflare's large developer platform and steadily adopted for edge apps, though smaller in installed base than mainstream databases.
Learning Curve2/5
Developers already building on Workers add D1 with a binding and standard SQLite SQL, so onboarding is quick; the main new concepts are edge replication and the per-database size model.
Flexibility2/5
It inherits SQLite's feature scope and is bound to the Cloudflare Workers runtime with a per-database size cap, so it is more constrained than a general-purpose managed database used over the network.
Performance4/5
Edge-distributed read replicas serve reads with low latency close to users, and the platform is engineered for fast Worker-to-database access, with writes centered on a primary.
Portability3/5
Data is SQLite-compatible and therefore exportable, but the service only runs on Cloudflare and is reached through Workers bindings, which creates meaningful platform lock-in.
About Cloudflare D1
Cloudflare D1 is a serverless SQL database built on SQLite and native to the Cloudflare Workers platform. It gives edge applications a real relational database that lives on Cloudflare's global network, so a Worker can query structured data close to the user without managing a database server. Queries use standard SQLite SQL, and the database is accessed through a Workers binding rather than a connection string, which means D1 is used from within the Cloudflare developer ecosystem rather than as a standalone endpoint.
It is designed for globally distributed reads. Read replication places copies near users for low-latency reads while writes go to a primary, and the Sessions API helps maintain read-your-writes consistency across requests. Individual databases are capped at 10 GB, which nudges architectures toward many smaller databases, a natural fit for per-tenant designs where each customer or project gets its own database.
D1 pairs well with edge-friendly ORMs such as Drizzle and Prisma and complements the rest of Cloudflare's storage lineup (KV, R2, Durable Objects). Pricing follows a usage model based on rows read and written plus storage, with a generous free tier included on the Workers Free plan and higher limits on Workers Paid. Because it is tied to Workers, D1 is most compelling for teams already building on Cloudflare.
Key Features
- SQLite-based serverless SQL database
- Runs natively on Cloudflare Workers via bindings
- Globally distributed read replicas
- Sessions API for read-your-writes consistency
- Usage-based pricing with a generous free tier
- Integrates with the Cloudflare storage ecosystem
Pros
- Real relational database at the edge with minimal setup
- Tight, low-latency integration with Workers
- Generous free tier for small projects
- Per-database model fits multi-tenant architectures well
Cons
- Requires the Cloudflare Workers platform, not a standalone database
- 10 GB per-database cap pushes work onto app-level sharding
- SQLite feature set is narrower than Postgres or MySQL
- Accessed via bindings rather than a standard connection string
Cloudflare D1 Pricing
Freemium- · Included with the Workers Free plan
- · 5 million rows read and 100,000 rows written per day
- · 5 GB total storage; 500 MB per database
- · First 25 billion rows read and 50 million rows written per month included
- · $0.001 per million rows read and $1.00 per million rows written beyond included
- · $0.75 per GB-month storage beyond included
- · 10 GB maximum per database
Tech Stacks with Cloudflare D1
Next.js + SQLite
ProjectA lightweight Next.js starter backed by SQLite/libSQL, with no database server to provision, with a managed edge path (Turso), a Cloudflare-native path (D1), or a fully self-hosted path depending on how the app deploys.
Tools Related to Cloudflare D1
Works well with Cloudflare D1(1)
Cloudflare D1 is queried from Cloudflare Workers through a binding — Workers is the runtime D1 is designed to be accessed from.
Integrates with Cloudflare D1(2)
Prisma has a Cloudflare D1 driver adapter for querying D1 from Workers with a type-safe client.
Drizzle integrates directly with Cloudflare D1 bindings, a common choice for Workers-based apps.
Alternatives to Cloudflare D1(2)
Turso and Cloudflare D1 solve the same job, SQLite at the edge, on different platforms. Turso is platform-independent via libSQL; D1 is bound to Cloudflare Workers.
Cloudflare D1 is a serverless, edge-hosted SQLite database — the same engine as local SQLite, run on Cloudflare's network.
Learning Resources
No resources yet — check back soon.
Vendor
Cloudflare
Website →Tags
Details
- Maintained
- Yes
- DB model
- Relational
- Query language
- SQL
- Hosting
- Cloud managed
- ACID compliant
- Yes
- Replication
- Yes