# 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 - Paid: 10M reads and 1M writes per month included, then $0.50 per million reads, $5.00 per million writes (deletes and lists too) and $0.50/GB-month - Writes to the same key: 1 per second, on every plan - Eventual consistency: ~60s global propagation; since January 2026 you can lower `cacheTtl` from its 60-second default to 30 seconds for fresher reads - Data location: namespace jurisdictions (`eu`, `us`, `fedramp`) are GA since October 2, 2026, set at creation only - Heads-up for scripts: the legacy API routes under `/workers/namespaces/` stop working on October 15, 2026; use `/storage/kv/namespaces/` - 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/ - Limits: https://developers.cloudflare.com/kv/platform/limits/ - Pricing: https://developers.cloudflare.com/kv/platform/pricing/ - Changelog, minimum cache TTL down to 30 seconds (2026-01-30): https://developers.cloudflare.com/changelog/post/2026-01-30-kv-reduced-minimum-cachettl/ - Changelog, legacy namespace API routes deprecated (2026-07-15): https://developers.cloudflare.com/changelog/post/2026-07-15-kv-legacy-namespace-routes-deprecation/ - Changelog, namespace jurisdictions GA (2026-10-02): https://developers.cloudflare.com/changelog/post/2026-10-02-kv-jurisdictions-ga/ ## Related - [[Cloudflare]] - [[Cloudflare Workers]] - [[Cloudflare D1]] - [[Cloudflare R2]] - [[Cloudflare Durable Objects]] - [[Cloudflare Flagship]] - [[Wrangler]]