Follow us
Breaking
Web Hosting

Cloudflare Workers KV performance shifts and the caching trade-off

Cloudflare's new hybrid architecture for Workers KV improved p99 read latencies from 200ms to under 5ms. This analysis compares the performance and cost of Workers KV against Upstash Redis and AWS DynamoDB for edge-native caching.

Share

Cloudflare rearchitected Workers KV in response to a June 12, 2025, outage that occurred when Google Cloud Platform experienced a global service disruption. The new hybrid architecture routes objects between distributed databases and R2 object storage based on size. Small objects, which make up the majority of traffic with a median size of 288 bytes, reside in the distributed database that powers R2 and Durable Objects. This change improved p99 read latencies from 200ms to under 5ms. I find these performance gains significant, although the Deno benchmark showed Cloudflare KV performing worst in latency tests because its heavy caching and eventual consistency model makes it difficult to measure propagated changes. Cloudflare engineers developed an adversarial test framework to find and fix read-your-own-write consistency violations. They did this by rapidly interspersing reads and writes to a small set of keys from locations around the world. The KV Storage Proxy manages connectivity, authentication, and shard routing to provide HTTP interfaces to database clusters. This service provides distributed storage for configuration data, session information, and static assets across 180+ edge locations. Users can create up to 20 namespaces, with each namespace supporting up to 1 billion keys. For developers using the platform, Workers start in less than 5ms and run for a maximum of 50ms. The service allows for 100,000 reads per second per key and up to one write per second per key.

The latency trade-off between pull-based and active replication

Teams choosing between Cloudflare Workers KV, Upstash Redis, and AWS DynamoDB must weigh consistency against latency. Upstash Redis uses active replication to keep data in sync across all regions, whereas Cloudflare moves data using a pull-based model where information moves to edge nodes only when a request arrives. In a benchmark using 14,275 key-value pairs, the Deno team found that Cloudflare KV performed worst in latency tests. The Deno team used 10,000 transactions to measure read and write latencies. They excluded network latency by colocating logic in edge functions and excluded cold start time by warming up the connection. In a specific test of 1,000 keys with 4KB to 64KB data sizes, Cloudflare’s p99 latency at 400 requests per second reached 560ms. This speed stays behind Upstash Redis. For those using DynamoDB, adding Amazon DynamoDB Accelerator (DAX) provides a write-through cache to reduce latency, but this adds a separate infrastructure layer that requires a minimum of three nodes for high availability. When you move from a direct connection to a managed cache like DAX, you add a network hop that can make writes take marginally longer than they would when you send them directly to DynamoDB. I would avoid DAX if you want to bypass the limitation where a write that bypasses the cache layer remains invisible until the TTL expires. DAX also keeps an item cache and a query cache that operate independently. This means an item update does not refresh any previously cached query results.

Economics of edge-native storage

The cost of Workers KV depends on whether you use the Free or Paid plan. The $5 monthly Workers Paid plan includes 1 GB of storage, 10 million reads, and 1 million writes. Beyond these limits, you pay $0.50 per GB for additional storage and $0.50 per million additional reads. I must note that Cloudflare’s writes cost $5 per million, which makes them the most expensive option in the Deno comparison.

Capability Workers KV Upstash Redis AWS DynamoDB
Median Read Latency 12 ms Not specified Not specified
Write Cost (per 1M) $5.00 Not specified Not specified
Storage Cost (per GB) $0.50 Not specified Not specified
Consistency Eventual Eventual Configurable

Developers use Workers KV for mass redirects, user authentication, translation keys, and configuration data. You can store values up to 2MB in size, though some older documentation mentioned a 64KB limit. In 2019, Cloudflare raised the maximum value size from 10MB to 25MB. You should check your write patterns before committing to the $5 per million write cost. Does the 60-second global consistency window work for your specific application? I recommend Workers KV for simple use cases where high latency is acceptable and you want everything in one place.

Share

Technewsdaily

Senior tech writer covering AI, gadgets and cybersecurity. Breaking down the news that matters, every day.