diff --git a/src/content/docs/workers/platform/storage-options.mdx b/src/content/docs/workers/platform/storage-options.mdx index ed1c046de1c260..06ddf40a8d247b 100644 --- a/src/content/docs/workers/platform/storage-options.mdx +++ b/src/content/docs/workers/platform/storage-options.mdx @@ -213,6 +213,8 @@ The new beta version of Durable Objects is available where each Durable Object h ::: + + ## 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. diff --git a/src/content/partials/kv/kv-vs-d1.mdx b/src/content/partials/kv/kv-vs-d1.mdx new file mode 100644 index 00000000000000..879e028c5396a4 --- /dev/null +++ b/src/content/partials/kv/kv-vs-d1.mdx @@ -0,0 +1,14 @@ +--- +{} +--- + +## Workers KV vs D1 + +Cloudflare Workers KV provides an eventually consistent global key-value store that caches data throughout 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 querying. D1 supports snapshot isolation consistency and is ideal for +workloads that store user data or general web application data. + +- Use Workers KV if you need to store and access configuration data that will be read by Workers frequently, 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).