Cloudflare D1 vs Cloudflare Durable Objects
Cloudflare D1: Serverless SQLite for Cloudflare Workers, priced per row read and written, with read replicas and time travel. Cloudflare Durable Objects: Single-threaded stateful actors at the edge, each with its own strongly consistent SQLite store.
key differences
- Cloudflare D1 is primarily a relational database; Cloudflare Durable Objects is key-value.
- Cloudflare Durable Objects is built for larger datasets (≤ 1 PB) than Cloudflare D1 (≤ 100 GB).
- Horizontal scaling is manual in Cloudflare D1 and native in Cloudflare Durable Objects.
- Only Cloudflare D1 has full-text search, triggers.
- Only Cloudflare Durable Objects has pub/sub.
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-durable-objects for
- +Chat rooms and collaborative editing backends
- +Multiplayer game and session state
- +Rate limiters and distributed counters
- +Per-user or per-tenant databases
best at · Edge, OLTP, Sessions
Cloudflare D1 vs Cloudflare Durable Objects: FAQ
What is the difference between Cloudflare D1 and Cloudflare Durable Objects?
Cloudflare D1: Serverless SQLite for Cloudflare Workers, priced per row read and written, with read replicas and time travel. Cloudflare Durable Objects: Single-threaded stateful actors at the edge, each with its own strongly consistent SQLite store. Cloudflare D1 is primarily a relational database; Cloudflare Durable Objects is key-value. Cloudflare Durable Objects is built for larger datasets (≤ 1 PB) than Cloudflare D1 (≤ 100 GB). Horizontal scaling is manual in Cloudflare D1 and native in Cloudflare Durable Objects.
When should I choose Cloudflare D1 over Cloudflare Durable Objects?
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 Durable Objects for chat rooms and collaborative editing backends; multiplayer game and session state; and rate limiters and distributed counters.
Is Cloudflare D1 or Cloudflare Durable Objects more popular?
Cloudflare Durable Objects ranks #346 on the WhichDB Score (7.2/100) and Cloudflare D1 ranks #373 (5.8/100). Popularity is not fit: check the requirements that matter for your project.
Are Cloudflare D1 and Cloudflare Durable Objects open source?
No. Cloudflare D1 is proprietary, closed-source software. No. Cloudflare Durable Objects is proprietary, closed-source software.