Reference guide · cloudflare · Published 2026-08-16 · 3 min read

Cloudflare Workers storage KV vs R2 vs D1

Compare Cloudflare Workers KV, R2 and D1 for a Worker. Learn which store fits key-value, object and relational data, and how consistency shapes the choice.

Three storage products

Cloudflare gives Workers three connected storage backends, each tuned for a different shape of data. Picking correctly removes most built-in pain.

How to decide

Ask what shape the data takes and how stale it may be:

NeedProduct
A single value keyed by a string, read at high rateKV
A file or blob, possibly large, read or written wholeR2
Rows you filter, join or count with SQLD1
One mutable record many clients must agree onDurable Objects

Rule of thumb:

Consistency matters

The decision is really about consistency and query model more than storage space. A write-then-read-immediately pattern breaks on KV because propagation lags; moving that counter or user bio to D1 or a Durable Object gives strong consistency. A workload that only needs "give me this config, and slightly stale is fine" is a perfect KV fit and costs far less than forcing it into SQL.

Store bulk assets in R2 rather than squeezing them into KV values, and keep a KV value small and self-contained. Combine stores when a workflow needs both, for example an R2 object whose metadata lives in D1 and a KV flag that tells the Worker where to find it. Understand the Worker request lifecycle and how one store can back an origin pool before wiring a storage layer into a load-balanced setup, and start from the Worker basics if the request model is new.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services