Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Go Realtime Channel Semantics for Logistics State You Actually Store

A realtime channel should carry a current logistics device event to authorized dashboard clients; it should not be treated as the system that remembers that event. The operational rule is blunt: commit durable device state to a database or log, publish a small notification that identifies the new state, and make every reconnect read from the durable source before resuming the live stream. Scope…

A real-time channel, such as a websocket or server-sent events connection, should simply transmit current logistics device events to authorized dashboard clients. It should not be considered a system that retains event information. The correct approach involves committing durable device state to a database or log, publishing a small notification indicating the new state, and ensuring every reconnect reads from the durable source before resuming the live stream.

Each connection token should be scoped to the tenant, facility, and permitted topic, as a browser displaying a token is an untrusted client, even when the user is trusted.

The channel serves as a delivery path with connection state, not a database. It may store bytes temporarily in network buffers and could potentially provide replay functionality, but neither of these features indicates durable storage, complete history, or recovery after a retention boundary. Separate SLOs (service level objectives) should be set for durable ingestion and dashboard freshness, and the gap between them should be tested.

In essence, what a real-time channel retains is an implementation detail, while the logistics operation needs to remember specific application requirements. The channel's primary role is to retain business state, which comprises the location of a device unit (e.g., unit-4821), the timestamp of its last report, and whether that observation supersedes an earlier one. These observations should be stored in an authoritative database, while the channel's role is limited to transmitting this information to subscribers.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

More from Dev.to on urgent.news

Report a problem with this story

Get the day's news by email. Daily, weekly or monthly. Sign up

More in Tech

More from Saturday, 17 October 2026 →