Cloudflare D1

SQLite-compatible serverless database in Cloudflare's edge runtime. Tight Workers integration.

VISIT CLOUDFLARE D1

Key takeaway: D1 makes sense as a consequence of a decision you already made, not as a database you shop for on its own. If your compute runs on Cloudflare Workers, having the database inside the same runtime removes an entire class of connection problems and costs very little. Outside that ecosystem there is no reason to choose it over Turso.

Quick facts

  • CategorySQLite at edge
  • EngineSQLite
  • PricingFreemium
  • LicenseProprietary
  • Created2023
  • GitHub starsclosed
  • PostgresNo
  • Edge-readyYes

Bundled features: Edge-first Workers integration

What it is

D1 is Cloudflare's SQLite-based serverless database. Tight Workers integration, free tier with 5GB storage and 25M row reads/day, low pricing past the free tier. Read replicas across Cloudflare's network for low-latency reads.

Best for

  • Cloudflare Workers apps wanting database in the same runtime
  • Cost-sensitive deployments, D1 is among the cheapest at scale
  • Edge-first architectures where data lives close to compute

When not to pick it

Skip D1 if you are not on Cloudflare Workers, the integration is the value. Skip for write-heavy workloads; Cloudflare's SQLite is read-optimised.

My take

D1 is the right fit for Cloudflare-stack apps. Outside that ecosystem, Turso is more flexible and Supabase / Neon are stronger for full-stack briefs.

Same runtime, so the connection problem disappears

Most serverless database pain is connection pain. Functions spin up faster than a database wants new connections, so you add a pooler, then a driver that speaks HTTP because edge runtimes cannot open a socket, then you spend an afternoon working out why the pooler behaves differently from a direct connection. D1 sidesteps all of it. The database is exposed to your Worker as a binding rather than a connection string, queries run from the isolate with no handshake, and there is no pool to size or exhaust. Local development mirrors it closely because the same SQLite engine runs on your machine. The result is that a Workers application with D1 has fewer moving parts than almost any other serverless database setup, and the operational surface you would normally spend a week hardening simply is not there. That simplicity is the product.

Where D1 stops, and what leaving looks like

D1 is read-optimised with a single writable primary and read replicas across Cloudflare's network, so write-heavy workloads are the wrong fit and no amount of tuning changes that. Individual databases have size ceilings, which is why the idiomatic pattern for large multi-tenant applications is many small databases rather than one big one, a design to choose deliberately rather than discover at capacity. You also get SQLite's feature set, not Postgres's, so there is no rich extension ecosystem and the type system is narrower. The exit is comparatively kind: it is SQLite, so a dump moves to Turso or a local file with little drama, though moving to Postgres means reworking types and query specifics. The real coupling is not the data, it is that your application is written for Workers, and that is the part that would take time to unwind.

Frequently asked questions

Is Cloudflare D1 production-ready?

Yes, for the workloads it targets: read-dominant applications running on Workers with modest write volume per database. It is not the choice for write-heavy systems or for a single database expected to grow without limit. Treat the many-small-databases pattern as the intended design for larger applications rather than as a workaround.

Can I use D1 outside Cloudflare Workers?

There is an HTTP API, so it is technically reachable from elsewhere, but you would be giving up the reason to use it. The value is the binding inside the Workers runtime, with no connection pooling and no network handshake. If your compute lives somewhere else, Turso gives you the same SQLite model without the platform assumption.

D1 or Turso?

D1 if you are on Workers and want the cheapest, most integrated option with the fewest moving parts. Turso if you want portability, more replica regions, the embedded-replicas read path, or an MIT-licensed engine you could self-host. Both are read-optimised SQLite, so neither answers a write-heavy brief; that is a Postgres question.

Links

Compare Cloudflare D1 side-by-side

Similar tools you should also consider

If Cloudflare D1 is your pick, the next conversation is short

The 30-min call is where your database choice becomes a real architecture, a migration plan if you are switching, and a price range you can take to your stakeholders. Describe your stack, your scale, your data shape. I tell you whether Cloudflare D1 is genuinely your fit.