Menu

Batching 100 Device Status Reports Into One Trusted Dashboard Channel
📰

Batching 100 Device Status Reports Into One Trusted Dashboard Channel

DEV Community: node·QuentinBarrett5281·12 days ago
#CraM6Suo
#devtonodejs#devto#dev#batch#device
Long article (2002 words) — no AI summary yet.
Reading 0:00
15s threshold

A page fires because the operations dashboard has stopped changing, yet device POSTs are still returning success. The on-call sees a green ingestion counter, a stale wallboard, and no useful answer to the first question: which page fired, and did devices go quiet or did publishing fail?

The answer is to accept device reports through the normal Node.js API, persist last_seen in the application's database, collect dirty status records, and publish one bounded batch to one dashboard channel on an interval. Devices should never receive subscriber credentials. The browser should receive a narrowly scoped, short-lived subscriber token from a trusted server, because putting a general service credential in an Express response turns every browser into part of the control plane.

TL;DR: last-seen is database state; the channel is a low-latency projection of that state. Batch publishing reduces the number of publish operations by a wide margin, but it also creates an intentional delay and a larger failure unit.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.