About Cloudflare D1
Cloudflare D1 is Cloudflare's managed, serverless SQL database, based on SQLite. Developers create databases and query them from Cloudflare Workers and Pages projects, so applications get a relational store without running database servers.
The documentation covers a Workers binding API with prepared statements, SQL features such as foreign keys and JSON queries, Wrangler commands, a REST API, import and export of data, indexes and local and remote development. Additional features include Time Travel and backups and a beta of global read replication. Example guides show how to query D1 from Hono, Remix, SvelteKit and Python Workers.
D1 is a proprietary Cloudflare service and is available on both Free and Paid plans, with billing and pricing described in the documentation.
Key features
- SQLite-based serverless SQL database
- Queries from Workers and Pages
- Time Travel and backups
- Global read replication in beta
- Wrangler CLI and REST API
- Import and export of data
Good fit for
- Relational storage for edge applications
- Small SQL databases for Workers projects
Cloudflare D1: questions and answers
- What is Cloudflare D1 used for?
- Cloudflare D1 is a serverless SQL database built on SQLite that Cloudflare Workers and Pages projects can query, available on free and paid plans. It is a good fit for relational storage for edge applications and small SQL databases for Workers projects.
- Is Cloudflare D1 free?
- Yes. Cloudflare D1 has a free plan. Free on the Workers Free plan with daily limits. On Workers Paid, extra rows written cost $1.00 per million, extra rows read $0.001 per million and extra storage $0.75 per GB-month; no egress fees.
- Is Cloudflare D1 open source?
- No. Cloudflare D1 is proprietary (closed-source) software and can't be self-hosted. Open-source alternatives to Cloudflare D1 include rqlite, libSQL and DuckDB.
- What are some alternatives to Cloudflare D1?
- Cloudflare D1 competes with PlanetScale, Upstash and AWS Device Farm. For open-source options, see Enlisted's ranked list of open-source Cloudflare D1 alternatives.
Open-source alternatives to Cloudflare D1
See all
rqlite
Databases
The lightweight, fault-tolerant database built on SQLite. Designed to keep your data highl
MITvs Cloudflare D1★ 18k
libSQL
Databases
libSQL is a fork of SQLite that is both Open Source, and Open Contributions.
MITvs Cloudflare D1★ 17k
DuckDB
Databases
DuckDB is an analytical in-process SQL database management system
MITvs MotherDuck★ 43k
TiDB
Databases
TiDB is built for agentic workloads that grow unpredictably, with ACID guarantees and nati
Apache-2.0vs Amazon Aurora★ 41k
SurrealDB
Databases
A scalable, distributed, collaborative, document-graph database, for the realtime web
OSSvs MongoDB Atlas★ 33k
Neon
Databases
Neon: Serverless Postgres. We separated storage and compute to offer autoscaling, code-lik
Apache-2.0vs Amazon Aurora★ 23k
SaaS alternatives to Cloudflare D1
See all
PlanetScale
Databases
Managed MySQL and Postgres with branching workflows and online schema changes
SaaS
Upstash
Databases
Serverless Redis, Kafka and vector database with per-request pricing
SaaS
AWS Device Farm
Testing & QA
AWS service for testing web and mobile apps on real devices in the cloud
SaaS
MongoDB Atlas
Databases
Managed MongoDB service across AWS, Azure and Google Cloud
SaaS
CockroachDB
Databases
Distributed SQL database with horizontal scaling, available as a managed cloud service
SaaS
Polyrouter
AI Infrastructure
Routes your AI traffic through a single endpoint
SaaS

SingleStore