Cloudflare D1

active

by Cloudflare · since 2022 · also known as D1

Serverless SQLite for Cloudflare Workers, priced per row read and written, with read replicas and time travel.

relationaldocumentmanaged serviceproprietarygrowing

Overview

D1 is Cloudflare's managed serverless database built on SQLite and run inside Durable Objects. You query it from Workers through a binding (or over HTTP), pay per row read and written rather than per instance, and get Time Travel point-in-time restore for 30 days plus global read replication via the Sessions API. Each database is capped at 10 GB and executes writes on a single primary, so the intended pattern is many small databases, such as one per tenant or user, rather than one big one. It is an easy, cheap default for apps already on Workers; for larger relational datasets, Cloudflare points you to Hyperdrive in front of external Postgres or MySQL.

Strengths & trade-offs

Strengths

  • +Zero-config SQL database bound directly to Cloudflare Workers
  • +Per-row pricing with large free daily allowances and no egress fees
  • +Time Travel restores to any minute in the last 30 days
  • +Global read replicas with sequential consistency via the Sessions API
  • +Familiar SQLite dialect, FTS5 and JSON functions

Trade-offs

  • −Hard 10 GB limit per database
  • −Single-writer per database limits write throughput
  • −Usable mainly from Cloudflare Workers; no wire protocol for standard drivers
  • −No fine-grained database users or roles

Great for

  • +Database-per-tenant SaaS on Workers
  • +Edge apps, blogs and CMS backends
  • +Configuration and feature metadata near users
  • +Prototypes needing SQL without managing servers

Think twice for

  • −Single databases larger than 10 GB
  • −Write-heavy workloads
  • −Applications outside the Cloudflare platform

Capabilities

Native or official first-party support · 9 of 25 tracked

✓Transactions
✓Joins
✓Secondary indexes
✓Full-text search
✓JSON
✓Triggers
✓Durable persistence
✓Encryption at rest
✓Time travel
–Vector search
–Geospatial
–Change data capture
–Stored procedures
–Materialized views
–TTL / expiry
–Pub/Sub
–Columnar storage
–In-memory
–Compression
–Role-based access
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Small · ≤ 100 GB
Horizontal scaling
Manual
Multi-region
Read replicas
Transactions
Full ACID
Consistency
Strong, Causal
Schema
Strict
Architecture
Serverless, Primary replica
Query languages
SQL

10 GB per database (500 MB on Free), up to 50,000 databases per account; scale out by sharding per tenant; read replicas in multiple regions.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

available on · Cloudflare

Ecosystem

compatible withSQLite
apis & protocolsWorkers binding API, REST API, Wrangler CLI
client languagesJavaScript, TypeScript, Python, Rust

Alternatives to Cloudflare D1

Compare all→
TursoRelational10.6

Managed SQLite-compatible cloud for database-per-tenant apps, with embedded replicas and offline sync.

cloudflare-d1 vs turso →
NeonRelational30.4

Serverless Postgres with copy-on-write branching and scale-to-zero, now part of Databricks.

cloudflare-d1 vs neon →
Cloudflare Durable ObjectsKey-Value7.2

Single-threaded stateful actors at the edge, each with its own strongly consistent SQLite store.

cloudflare-d1 vs cloudflare-durable-objects →
SQLiteRelational75.5

The in-process SQL engine that ships in every phone, browser and OS: one file, zero servers.

cloudflare-d1 vs sqlite →
SupabaseRelational54.3

Open-source Postgres backend platform: database, auth, storage, realtime and edge functions in one project.

cloudflare-d1 vs supabase →
Prisma PostgresRelational14.6

Serverless Postgres from the Prisma ORM team, on unikernels, billed per operation with no cold starts.

cloudflare-d1 vs prisma-postgres →

Cloudflare D1 FAQ

What is Cloudflare D1?

Cloudflare D1 is a relational database by Cloudflare, first released in 2022. D1 is Cloudflare's managed serverless database built on SQLite and run inside Durable Objects. You query it from Workers through a binding (or over HTTP), pay per row read and written rather than per instance, and get Time Travel point-in-time restore for 30 days plus global read replication via the Sessions API. Each database is capped at 10 GB and executes writes on a single primary, so the intended pattern is many small databases, such as one per tenant or user, rather than one big one. It is an easy, cheap default for apps already on Workers; for larger relational datasets, Cloudflare points you to Hyperdrive in front of external Postgres or MySQL.

Is Cloudflare D1 open source?

No. Cloudflare D1 is proprietary, closed-source software.

Does Cloudflare D1 support ACID transactions?

Yes. Cloudflare D1 supports full ACID transactions, with strong, causal consistency.

Does Cloudflare D1 scale horizontally?

Cloudflare D1 has no built-in sharding; scaling out means partitioning data in your application. It is comfortable at small scale (≤ 100 GB). It supports cross-region read replicas.

How can I run Cloudflare D1?

You can use the vendor's managed cloud, run it serverless and run it at the edge. It is available on Cloudflare.

What is Cloudflare D1 best for?

Cloudflare D1 is a strong fit for database-per-tenant SaaS on Workers; edge apps, blogs and CMS backends; and configuration and feature metadata near users. Think twice for single databases larger than 10 GB.

What are the best alternatives to Cloudflare D1?

Common alternatives to Cloudflare D1 include Turso, Neon, Cloudflare Durable Objects, SQLite and Supabase. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is Cloudflare D1?

Cloudflare D1 ranks #373 of 844 databases on the WhichDB Score (5.8/100), and #119 among relational databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.