· via Cloudflare blog
Cloudflare launches K2, a serverless event streaming service built on R2
Cloudflare's K2, now in public beta, is a durable event streaming primitive that decouples producers from consumers, storing ordered event logs on R2 object storage with long-term retention.

Cloudflare has launched K2, a serverless event streaming service, in public beta. According to the Cloudflare blog, K2 is a durable event streaming primitive on the company's Developer Platform: producers write events to a stream, which stores them as an ordered log, and consumers read from it at their own pace — either splitting reads across a group of consumers or receiving every message independently.
What K2 is solving
Cloudflare frames the problem around traditional Remote Procedure Call architectures, where producers and consumers must align in both scale and time. If producers send more data than consumers can handle, or a downstream service goes offline, events get dropped. The issue compounds when multiple consumers — for instance an analytics system and a fraud detection service both reading ecommerce transaction events — need to process the same data independently. K2 inserts a durable buffer between the two sides, absorbing writes while readers consume at their own speed. Because it supports long-term retention, even extended consumer downtime does not lose data.
Built for the edge, on top of R2
Cloudflare says K2 grew out of an internal need: Basin Pipelines, its stream processing engine, uses a pull-based model and required a durable ingestion buffer in front of it — storage that could hold events over potentially long periods, since Pipelines commits to never dropping events once accepted.
That is a job most companies would give to Apache Kafka, but Cloudflare notes that Pipelines runs on its edge network spanning more than 335 cities, where traditional distributed systems software often cannot run. Machines are provisioned in small slices, are relatively short-lived, and networking frequently travels over the public Internet. The compensating strengths are proximity to users worldwide and strong horizontal scalability.
So K2 was built on R2, Cloudflare's object storage. R2 provides 11 nines of durability and strongly consistent APIs, letting K2 push replication and consensus down to the storage layer — which Cloudflare says makes the application layer simpler, cheaper and higher-performing, while separating compute from storage so each scales independently.
One wrinkle: object stores do not support appends, the natural operation for a log. K2 instead accumulates writes in memory on an edge service and flushes them as complete segment files, sized to amortise the cost of writing and reading each one. Ordering and strictly incrementing offsets are achieved through R2's atomic operations, without a separate coordination service. The trade-off is produce latency: roughly one second at the 99th percentile in this initial release. Cloudflare says a technical deep dive is forthcoming.
When to use K2, Queues or Pipelines
Cloudflare already offers other asynchronous delivery products, and the blog draws clear distinctions:
- Queues is designed around tracking individual items of expensive or time-consuming work, supporting per-message logic such as retries, delays and dead-letter queues.
- K2 targets high-scale data movement, long-term retention and fan-out consumption. Messages are produced and consumed as batches, which enables efficient processing but rules out message-level retries and introduces higher producer latency than queues.
- Basin Pipelines suits cases where the end goal is landing JSON events in R2 or Iceberg tables; K2 is the better fit for custom processing or writing to other destinations.
Getting started
Streams can be created with the cf CLI, Wrangler, the dashboard or the API. Events are produced through an HTTP API or a Worker binding, and since K2 represents data as bytes, any format or encoding works. On the consumption side, subscriptions divide work among consumers to enable read parallelism, and each consumer polls its subscription.
Why it matters
Event streaming has largely meant operating Kafka or one of its managed equivalents — systems that assume stable clusters of well-provisioned machines. K2 is a working demonstration that a durable, ordered log can be assembled from serverless building blocks: edge compute plus object storage. For developers, it adds a Kafka-shaped primitive to Cloudflare's platform with no brokers to operate and retention costs tied to cheap object storage. The roughly one-second p99 produce latency means it is not a drop-in replacement for latency-sensitive workloads, but for analytics pipelines, fan-out consumption and buffering spiky producers, the decoupling it offers — plus the durability guarantees inherited from R2 — make it a notable new entry in the serverless toolkit.
- #cloudflare
- #event-streaming
- #serverless
- #object-storage
- #kafka