
Cloudflare launches K2 in public beta: serverless event streams built on R2
Cloudflare has launched K2 in public beta, a serverless event-streaming service that stores events as an ordered log on R2 object storage. First built for Basin Pipelines, it targets high-scale data movement with long-term retention.
Cloudflare announced on October 1 that K2, a durable event-streaming primitive for its Developer Platform, is entering public beta. Events sent to a K2 stream are stored as an ordered log; consumers can split reads across a pool of readers or have every message delivered to every consumer. The service is fully serverless, keeps data for long periods, and survives extended consumer downtime without losing events.
K2 addresses a core constraint of traditional RPC architectures: producers and consumers must match in scale and in time, so events are dropped whenever a consumer falls behind or goes away. A durable buffer in the middle lets independent readers consume at their own pace; in K2, that buffer is a partitioned log built on R2 object storage.
How K2 works
Object storage does not support appends, so K2 accumulates writes in memory and flushes them as complete segment files. Ordering and offsets come from R2's atomic operations, with no separate coordination service. The trade-off is latency: object storage writes are slower than local disk, and waiting for batches adds up to about one second of produce latency at the 99th percentile in the initial release.
K2 started as an internal project: it was built as the ingestion layer for Basin Pipelines, which needed durable buffering for events before they were read and written to R2. Most companies would deploy Apache Kafka, but Pipelines runs on Cloudflare's edge across more than 335 cities, where classic distributed systems are impractical to operate, so the team turned to R2.
K2, Queues, or Pipelines?
Cloudflare already offers other asynchronous primitives, including Queues and Basin Pipelines. Queues is designed around individual units of costly or time-consuming work, with per-item retries, delays, and dead-letter queues. K2, by contrast, targets high-scale data movement, long-term retention, and fan-out consumption: messages are produced and consumed in batches, which improves efficiency but gives up message-level retries and raises producer latency compared with Queues.
Basin Pipelines remains a serverless ingestion service for JSON events written to R2 or the Basin Catalog. Cloudflare recommends Pipelines when the end result is events landing in object storage or Iceberg tables, and K2 for custom processing or other destinations.
Availability and pricing
K2 is in public beta for Workers Paid accounts, with limits of 10 GB of storage and 30 MB/s of produce throughput per stream; higher limits are available on request. Usage is not billed during the beta. Cloudflare anticipates charging $0.04 per GB produced, $0.04 per GB consumed, and $0.02 per GB per month for retained data.
The roadmap includes higher write parallelism toward multi-GB/s streams, message keys with key-based ordering guarantees, push-based worker consumers, a lower-latency Express tier, and drop-in support for Apache Kafka clients.
SiTech — AI-powered web development
We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.