Cloudflare has launched Cloudflare K2 in public beta, introducing a durable, serverless event streaming service for its Developer Platform. The primitive decouples data producers from consumers by capturing events into an ordered log, enabling asynchronous processing and data movement at scale.
Log Architecture Built on Object Storage
Designed to overcome the operational challenges of running traditional distributed software like Apache Kafka across Cloudflare's edge network, K2 implements its partitioned log on top of R2 object storage. Because object stores do not natively support append operations, K2 buffers writes in-memory on edge servers before flushing them as segment files to R2, utilizing atomic operations to maintain strict offsets without a dedicated coordination layer.
This decoupling of compute and storage allows independent scaling and long-term data retention. However, relying on object storage introduces a latency tradeoff: initial produce latencies reach approximately one second at the 99th percentile.
Flexible Consumption Models
K2 supports batch-based message delivery across diverse consumption patterns. Developers can split event reads across a pool of consumers for parallel processing or create separate subscriptions to fan out every message to multiple systems simultaneously.
Consumers poll subscriptions to receive a five-minute batch lease, after which they can acknowledge completion, negatively acknowledge for redelivery, or extend the lease period. Streams accept binary data formats and interact directly with HTTP APIs or Cloudflare Worker bindings.
Availability and Product Boundaries
Cloudflare positions K2 for high-scale data routing and long-term buffering, contrasting it with Cloudflare Queues—which handle individual retries and complex message-level workflows—and Basin Pipelines, which focus on JSON ingestion into storage targets.
The public beta is available to accounts with Workers Paid subscriptions without usage billing during the beta phase. Default limits are capped at 10GB of storage and 30 MB/s produce throughput per stream. Cloudflare plans to add Kafka client support, key-based ordering, and lower-latency express tiers in future updates.
AI-generated editorial illustration; not a documentary photograph.
Source: Announcing Cloudflare K2: serverless event streams

Leave a Reply