Skip to content
InfoQ·

🚀Cloudflare K2 Beta: Serverless Event Streaming for the Masses

K2: Cheaper Kafka Alternative with a Twist

TL;DR

Cloudflare's K2 is now in public beta, offering a cheaper alternative to Kafka with 1s p99 latency. It's built for cost and elasticity, using R2 object storage. Pricing is $0.04 per GB produced, $0.02 per GB per month for retention, and nothing during the beta.

Cloudflare just launched K2 in public beta, a serverless event streaming service that uses R2 object storage for a partitioned durable log. The trade-off is 1s p99 latency, but it's cheaper than Kafka. If you're running Kafka for event streaming, K2 could save you money, especially for longer retention. Pricing is $0.04 per GB produced and $0.02 per GB per month for retention, with no charges during the beta. K2 is built for cost and elasticity, making it a game-changer for teams looking to reduce cloud expenses.

Cloudflare K2 Beta: Serverless Event Streaming for the Masses — InfoQ

Key Points

1

K2 uses R2 object storage for a partitioned durable log, offering eleven nines of durability with strongly consistent APIs.

2

Pricing: $0.04 per GB produced, $0.02 per GB per month for retention, with no charges during the beta.

3

K2 holds writes in memory on an edge service, then writes the batch out as a segment file, with R2's atomic operations for ordering and incrementing offsets.

4

The beta limits are 10GB of storage and 30 MB/s produce per stream, with future work including message keys, key-based ordering, and Kafka client support.

5

K2 is built for the Cloudflare ecosystem, using a lease-based consume API for higher read parallelism, and is cheaper than self-hosted or cloud-hosted Kafka.

Why It Matters

If you're running Kafka for event streaming, K2 could save you money, especially for longer retention. Pricing is $0.04 per GB produced and $0.02 per GB per month for retention, with no charges during the beta. The 1s p99 latency might be a trade-off, but the cost savings could be significant for teams looking to reduce cloud expenses.

cloudflarek2serverlessevent-streamingkafka-alternative

Comments

Subscribe to join the conversation...

Be the first to comment

Enjoyed this article?

Get it daily. 7am. Free. Reads in 5 minutes.

Join 3,565 builders reading daily.

Also get