Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/content/docs/workers/platform/storage-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ The new beta version of Durable Objects is available where each Durable Object h

:::

<Render file="kv-vs-d1" product="kv" />

## D1 vs Hyperdrive

D1 is a standalone, serverless database that provides a SQL API, using SQLite's SQL semantics, to store and access your relational data.
Expand Down
14 changes: 14 additions & 0 deletions src/content/partials/kv/kv-vs-d1.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
{}
---

## Workers KV vs D1

Cloudflare Workers KV provides an eventually consistent global key-value store that caches data throughput Cloudflare's network to provide
low read latency for hot reads to keys. This is ideal for storing data that is repeatedly read by your Workers, such as configuration data, user preferences, cached values, etc. Workers KV can sustain high read throughput (unlimited requests per second per key) with \<5ms latency globally for hot reads. Workers KV is eventually consistent, so writes may take up to 60 seconds to propagate through Cloudflare's network by default.

Cloudflare D1 provides a SQL database that supports relational data modeling and quering. D1 supports snapshot isolation consistency and is ideal for
workloads that store user data or general web application data. D1 currently stores data regionally (with read replicas coming soon).

- Use Workers KV if you need to store and access configuration data with that will be read by Workers frequently, that is written infrequently (\<1 RPS per key) and can tolerate eventual consistency.
- Use D1 if you need to store general application data, need SQL access to your data, and require strong consistency (writes are immediately visible after being committed).
Loading