Cloudflare D1

SaaS

Serverless SQL database built on SQLite that Cloudflare Workers and Pages projects can query, available on free and paid plans.

developers.cloudflare.com
Cloudflare D1 homepage screenshot

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
Tags
sqlite
serverless
cloudflare
sql
edge
workers
database

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

SaaS alternatives to Cloudflare D1

See all