Cloudflare K2: serverless event streams (public beta)
- ID: 4f45a66b
- 原文链接: https://blog.cloudflare.com/cloudflare-k2-streams/
- 作者: Cloudflare
- 日期: 2026-10-01
- 分类: infra
- 来源类型: article
- 标签: event-streaming、serverless、cloudflare、r2
- 质量评分: 3/5
- 抓取时间: 2026-10-02 (daily-intake-evening, opencli/web fetch)
中文导读
Cloudflare 发布 serverless 事件流 K2 公测:把 producer/consumer 解耦,在 R2 对象存储之上实现分区持久日志,事件按序存储、支持长期 retention,消费者可以分摊读取或全量广播,长时间宕机也不丢数据。起源是自家需求:Basin Pipelines 的流处理引擎是 pull 模型,需要一条绝不丢事件的持久缓冲层。实现上消息先在 edge 节点内存攒成 segment,再用 R2 的原子操作拿到严格排序与递增 offset,省掉独立协调服务;代价是 produce 端 p99 约 1 秒(等 segment 攒齐再写 R2)。与 Queues 的分工:Queues 适合单条重活加 retry/DLQ,K2 适合批量、高扇出与长期保留。
为什么值得关注
Cloudflare 把对象存储当状态原语又落一子:K2 用 R2 原子操作换掉协调服务,1 秒 p99 换不丢事件的长保留缓冲。
English Summary
Cloudflare launches K2, a serverless durable event-streaming primitive, in public beta: producers and consumers are decoupled via a partitioned durable log on top of R2 object storage - events are stored in order, long-term retention is supported, consumers can split reads or fan out, and long consumer downtime loses nothing. It originated from an internal need: Basin Pipelines' pull-based stream-processing engine needed a never-drop durable buffer. Messages are accumulated into segments in edge memory, then R2 atomic operations provide strict ordering and monotonically increasing offsets without a separate coordination service; the trade-off is roughly 1s p99 on the produce side while segments fill. Versus Queues: Queues fits single heavy jobs with retry/DLQ; K2 fits batch, high fan-out, and long retention.
Obsidian 原文摘录(抓取正文头部)
# Announcing Cloudflare K2: serverless event streams
> 发布时间: 2026-10-01T13:00:00.000Z
> 原文链接: https://blog.cloudflare.com/cloudflare-k2-streams/
---
With traditional Remote Procedure Call (RPC) architectures, there exists a core challenge: producers and consumers must align in scale and in time. If your producers send too much data for your consumers to handle or if your consumers or downstream services become unavailable, events are dropped. This problem is compounded with multiple consumers that need to independently process the data. For example, an ecommerce backend may emit events when transactions are completed, which need to be read by an analytics system and a fraud detection service.
We can solve this by _decoupling_ our producers and consumers — inserting a service in the middle that absorbs writes while allowing independent readers to consume at their own pace.
Today we are launching Cloudflare K2 in public beta to solve this problem. K2 is a durable event streaming primitive on the Developer Platform. You send events to a K2 stream, which stores them as an ordered log. Consumers can read them in a variety of ways, for example by splitting up reads across a set of consumers, or delivering all messages to all consumers. It's fully serverless, scales to vast quantities of data, and supports long-term retention, so even long periods of consumer downtime do not lose data.
Under the hood, K2 implements a partitioned, durable log on top of R2 object storage, which allows it to scale to huge volumes of storage.
If you’re ready to get started, you can create your first stream in seconds by following [the guide here](https://developers.cloudflare.com/k2/get-started/?cf_page=cloudflare-k2-streams%2F).
## [Copy link](https://blog.cloudflare.com/cloudflare-k2-streams/#streams-on-the-edge)Streams on the edge
We first built K2 because _we_ needed a durable buffer on the edge, initially to serve as the ingestion layer for [Basin Pipelines](https://developers.cloudflare.com/pipelines/?cf_page=cloudflare-k2-streams%2F). Pipelines is powered by a [stream processing engine](https://www.arroyo.dev/) that operates on a pull-based model, which means some other system has to
Notes
- Content grounded in a same-day fetch (opencli web read / twitter thread / direct HTTP) during daily-intake-evening.
- 中文导读 block is the entry's summary_zh (verbatim); 为什么值得关注 is the entry's one_liner; no claims beyond the fetched source text were added.
- Source file cached at /tmp/aaif-evening/k2.md during the run.