Cloudflare launches K2, a serverless event streaming primitive on R2
Key point
K2 is available in public beta for Workers Paid accounts, offering durable event streaming with 11 nines of durability and long-term retention.
Details
Cloudflare has launched K2 in public beta, a durable event streaming primitive designed to decouple producers and consumers on the Developer Platform. Unlike traditional RPC architectures where scale and timing must align, K2 absorbs writes into an ordered log, allowing consumers to read at their own pace without dropping data during downtime.
Architecture and Performance
K2 implements a partitioned, durable log on top of R2 object storage, leveraging R2's 11 nines of durability and strongly consistent APIs. This approach offloads replication and consensus to the storage layer, simplifying the application layer and enabling independent scaling of compute and storage. Because R2 does not support appends, K2 accumulates writes in-memory before writing complete segment files, resulting in a produce latency of approximately 1 second at the 99th percentile.
Use Cases and Differentiation
K2 is built for high-scale data movement, long-term retention, and fan-out consumption, distinct from Cloudflare's existing Queues and Basin Pipelines:
- Queues are optimized for individual, expensive work items with complex logic like retries and dead-letter queues.
- Basin Pipelines is recommended for serverless ingestion that writes directly to object storage or Iceberg tables.
- K2 supports batch processing and custom destinations, making it suitable for analytics and fraud detection systems that need independent, parallel consumption.
Availability and Pricing
K2 is available today for accounts with Workers Paid subscriptions, with usage free during the beta period. Current limits include 10GB of storage and 30 MB/s produce per stream. Future pricing is anticipated to be $0.04/GB for data produced and consumed, and $0.02/GB/month for retained data. The roadmap includes higher write parallelism, message keys, push-based consumers, and drop-in support for Apache Kafka clients.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.