vs

Cloudflare D1 vs Cloudflare Workers KV

Cloudflare D1: Serverless SQLite for Cloudflare Workers, priced per row read and written, with read replicas and time travel. Cloudflare Workers KV: Globally cached, eventually consistent key-value store for read-heavy data at Cloudflare's edge.

key differences

  • Cloudflare D1 is primarily a relational database; Cloudflare Workers KV is key-value.
  • Cloudflare Workers KV is built for larger datasets (≤ 1 PB) than Cloudflare D1 (≤ 100 GB).
  • Horizontal scaling is manual in Cloudflare D1 and native in Cloudflare Workers KV.
  • Transactions: Cloudflare D1 offers full ACID; Cloudflare Workers KV offers none.
  • Only Cloudflare D1 has transactions, joins, secondary indexes, full-text search, triggers.
  • Only Cloudflare Workers KV has ttl / expiry.

choose cloudflare-d1 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

best at · OLTP, Edge, Content

choose cloudflare-workers-kv for

  • +Feature flags and configuration at the edge
  • +URL redirects and routing tables
  • +Authentication tokens and API key lookups
  • +Caching rendered pages or API responses

best at · Edge, Cache, Coordination

overview
Primary model
Relational
Key-Value
Also supports
Document
–
Type
Managed service
Managed service
Status
Active
Active
Developer
Cloudflare
Cloudflare
First release
2022
2018
Latest version
–
–
License
ProprietaryProprietary (Cloudflare service)
ProprietaryProprietary (Cloudflare service)
Free tier
✓
✓
popularity
WhichDB Score
5.8
4.4
Rank
#373
#404
GitHub stars
–
–
Stack Overflow questions
–
12
scale & guarantees
Comfortable data size
Small (≤ 100 GB)
Large (≤ 1 PB)
Horizontal scaling
Manual
Native
Multi-region
Read replicas
Read replicas
ACID
Full
None
Consistency
Strong, Causal
Eventual
Schema
Strict
Schemaless
Architecture
Serverless, Primary replica
Distributed, Serverless
deployment
Self-hosted
—
—
Vendor-managed cloud
✓
✓
Serverless
✓
✓
Embedded
—
—
Edge
✓
✓
Clouds
Cloudflare
Cloudflare
capabilities
Transactions
✓
—
Joins
✓
—
Secondary indexes
✓
—
Full-text search
✓
—
Vector search
—
—
Geospatial
—
—
JSON
✓
✓
Change data capture
—
—
Triggers
✓
—
Stored procedures
—
—
Materialized views
—
—
TTL / expiry
—
✓
Pub/Sub
—
—
Columnar storage
—
—
In-memory
—
—
Durable persistence
✓
✓
Compression
—
—
Encryption at rest
✓
✓
Role-based access
—
—
Time travel
✓
—
Branching
—
—
Online schema changes
—
—
Streaming ingest
—
—
Offline sync
—
—
Runs in WebAssembly
—
—
interfaces
Query languages
SQL
Workers KV API
Client languages
JavaScript, TypeScript, Python, Rust
JavaScript, TypeScript, Python, Rust
Best for
OLTP, Edge, Content, Coordination
Edge, Cache, Coordination, Sessions

Cloudflare D1 vs Cloudflare Workers KV: FAQ

What is the difference between Cloudflare D1 and Cloudflare Workers KV?

Cloudflare D1: Serverless SQLite for Cloudflare Workers, priced per row read and written, with read replicas and time travel. Cloudflare Workers KV: Globally cached, eventually consistent key-value store for read-heavy data at Cloudflare's edge. Cloudflare D1 is primarily a relational database; Cloudflare Workers KV is key-value. Cloudflare Workers KV is built for larger datasets (≤ 1 PB) than Cloudflare D1 (≤ 100 GB). Horizontal scaling is manual in Cloudflare D1 and native in Cloudflare Workers KV.

When should I choose Cloudflare D1 over Cloudflare Workers KV?

Choose Cloudflare D1 for database-per-tenant SaaS on Workers; edge apps, blogs and CMS backends; and configuration and feature metadata near users. Choose Cloudflare Workers KV for feature flags and configuration at the edge; URL redirects and routing tables; and authentication tokens and API key lookups.

Is Cloudflare D1 or Cloudflare Workers KV more popular?

Cloudflare D1 ranks #373 on the WhichDB Score (5.8/100) and Cloudflare Workers KV ranks #404 (4.4/100). Popularity is not fit: check the requirements that matter for your project.

Are Cloudflare D1 and Cloudflare Workers KV open source?

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