# Cloudflare KV
[[Cloudflare]] KV (Workers KV) is a globally-distributed, eventually-consistent key-value store designed for read-heavy edge workloads. Writes propagate to all POPs within ~60 seconds; reads are served from the nearest POP in single-digit milliseconds.
KV is built for one shape of problem: data that's written rarely and read constantly from everywhere. Configuration, feature flags (before [[Cloudflare Flagship]]), session state, A/B test buckets, rendered HTML cache. It is not a database — there are no transactions, no queries, no indexes. Just `get(key)` and `put(key, value)`.
## Why It Matters
For [[Cloudflare Workers]] code, KV gives a free read-cache that's already at every POP. Hitting KV is faster than hitting [[Cloudflare D1]] or any origin database, because there is no network hop beyond the POP. The trade-off is eventual consistency — your write is not guaranteed visible everywhere until ~60s pass.
## When to Use What
- **KV**: read-heavy, eventual consistency OK, ≤25 MB values, ≤512-byte keys
- **[[Cloudflare D1]]**: relational queries, transactional writes, structured data
- **[[Cloudflare Durable Objects]]**: strong consistency, single-key coordination, real-time state
- **[[Cloudflare R2]]**: large blobs, files, media
## Limits Worth Knowing
- Value size: 25 MB max
- Key size: 512 bytes
- Free: 100K reads/day, 1K writes/day, 1 GB storage
- Eventual consistency: ~60s global propagation
- Not suitable for: counters, real-time data, anything needing read-after-write guarantees
## References
- KV home: https://developers.cloudflare.com/kv/
- API reference: https://developers.cloudflare.com/kv/api/
## Related
- [[Cloudflare]]
- [[Cloudflare Workers]]
- [[Cloudflare D1]]
- [[Cloudflare R2]]
- [[Cloudflare Durable Objects]]
- [[Cloudflare Flagship]]
- [[Wrangler]]