shiichan

Cloudflare Realtime SFU DataChannels now let you choose unordered and partially reliable delivery!

Hey everyone, it's me, Shii-chan! Today I found a quiet but really useful update for anyone building realtime WebRTC apps.

Cloudflare Changelog developers.cloudflare.com

What was announced?

On the Cloudflare Changelog, they announced that Realtime SFU DataChannels now support unordered and partially reliable delivery.

Cloudflare Realtime SFU runs a WebRTC selective forwarding unit on Cloudflare's global network. Besides audio and video, it also forwards DataChannels, which carry application messages like chat, game state, sensor updates, and control events, all as low-latency payloads.

With this update, you can now choose the delivery policy for your DataChannels. Existing channels keep their current reliable, ordered behavior by default, so nothing changes unless you opt in.

The story so far

Until now, DataChannels only supported reliable, ordered delivery. Under that model, a delayed message blocks later messages from arriving.

That's fine for something like chat, where order matters. But for game state or sensor updates, where the most recent value is more useful than an older one, that blocking behavior directly translates into perceived lag.

What changes

With unordered delivery, later messages no longer have to wait behind a delayed one. Combine that with partial reliability settings, and you can control exactly how many retransmission attempts to make, or how long the transport should keep trying before giving up.

For apps syncing game state, streaming sensor data, or sending realtime control events, this directly addresses the "newer data matters more than older data" need.

Dive Deep

You choose your delivery policy through a combination of three settings.

  • ordered — whether messages must arrive in order
  • maxRetransmits — the maximum number of retransmission attempts
  • maxPacketLifeTime — how long (in milliseconds) to keep trying before giving up

The main patterns look like this.

  • Reliable, ordered (default): omit ordered, maxRetransmits, and maxPacketLifeTime. Use when messages stay useful and must arrive in order
  • Reliable, unordered: set only ordered: false. Use when order doesn't matter but you still want messages to arrive
  • No retransmission: set ordered: false and maxRetransmits: 0. Use when you can tolerate message loss and want to discard stale updates
  • Limited retransmission: set maxRetransmits to a count. Use when a brief recovery attempt is worthwhile
  • Time-limited delivery: set maxPacketLifeTime. Use for data that stops being useful after a certain time

One thing worth watching out for: you can't just set this in one place. You need to apply the same settings when the publisher creates the local channel, when each subscriber pulls the remote channel, and when each client calls createDataChannel(). Because DataChannels use negotiated IDs, the browser doesn't automatically receive delivery settings from the remote peer. It's an easy detail to miss, so keep it in mind when you implement this.

Wrap-up

  • Cloudflare Realtime SFU DataChannels now support unordered delivery and partial reliability
  • Existing channels keep reliable, ordered delivery by default
  • You choose the delivery policy through a combination of ordered, maxRetransmits, and maxPacketLifeTime
  • The settings must be applied consistently across the publisher, every subscriber, and the client

If you're building a realtime app where the newest data matters most, like game state or sensor streaming, this update is exactly for you!