FDE Times dataFDE jobs open 932▼14 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 62Companies hiring 202Remote-friendly 24%Median US pay $201kTop hirer Databricks 92
中文VI

The newspaper of the Forward Deployed Engineer

Guides

The factory network drops, and edge defaults start discarding data

Size the buffers before go-live and you will know how many hours of sensor data the edge can hold through an outage.

ShareLinkedInFacebookX

In brief

  • edgeHub's default TTL is 7,200 seconds (two hours); Telegraf holds 10,000 metrics in RAM, then overwrites the oldest
  • Mosquitto keeps its queue in RAM by default and, per the standard, queues only QoS 1 and 2 messages, so QoS 0 data is lost when the network drops
  • Multiply the data rate by the longest outage to get TTL and disk space, then pull a real network cable to check
Horizontal bar chart on a scale of 0 to 8 hours, at 200 metric/s. With default settings, the Mosquitto buffer holds 5 seconds of data, Telegraf 50 seconds and edgeHub (TTL) 7,200 seconds, or 2 hours. All fall far short of the longest outage, 28,800 seconds or 8 hours, shown in orange.
At 200 metric/s, the default buffers in Mosquitto and Telegraf hold only a few seconds to under a minute of data, while edgeHub's TTL stops at two hours. The longest outage lasted eight hours. Source: Mosquitto, Telegraf and Microsoft Azure IoT Edge documentation, plus the article's hypothetical example.

Two hours. According to Microsoft’s documentation, that is how long edgeHub in Azure IoT Edge holds a message waiting to go to the cloud by default: 7,200 seconds. If the factory network drops at the start of the night shift and stays down until morning, any data older than two hours never reaches the dashboard.

For an FDE on an industrial project, this is close to certain to happen. HiveMQ, an MQTT vendor, says plainly that industrial networks are often unreliable, with limited connectivity and bandwidth. The client will not ask about TTL. They will ask why the furnace temperature chart has a gap on exactly the night the machine failed.

The skill here is reading the buffer at each layer of the pipeline, working out how long it lasts, and proving it before acceptance day. Most tools offer store-and-forward. The trouble lies in their defaults.

What store-and-forward promises, and what it doesn’t

HiveMQ defines store-and-forward as queuing and storing messages on disk when the connection is lost, then sending them once it returns.

Azure IoT Edge goes further: after its first sync with IoT Hub, a device can run offline indefinitely, outgoing telemetry is stored locally, and when the network comes back the messages are delivered in the order they were stored.

AWS IoT Greengrass also designs its stream manager for intermittent connectivity.

Running offline indefinitely does not mean storing data indefinitely, though. Microsoft itself notes that message storage depends on TTL and available disk space. The device stays alive while the data expires on a clock.

So for each layer, three questions need answers. Does the buffer sit in RAM or on disk? Is it capped by time or by count? When it fills up, what does it drop?

Each tool drops data in its own way

Telegraf, the metrics collection agent, buffers in RAM by default, up to 10,000 metrics per output. When the buffer is full, the oldest metrics are overwritten by new ones.

For more durability, set buffer_strategy = "disk" and declare a buffer_directory. The buffer_disk_sync parameter is where the trade-off sits: turning sync off makes writes faster, but a power cut can lose data that had not yet been durably written.

In the Mosquitto MQTT broker, the default queue holds 1,000 QoS 1 and 2 messages per client, in RAM only; writing to disk requires enabling persistence. The detail more often missed: under the MQTT 3.1.1 standard, only QoS 1 and 2 messages are queued, and queuing QoS 0 is an optional, non-standard feature.

A sensor publishing at QoS 0 loses its data when the network drops. More broadly, HiveMQ notes that with persistent sessions, the main limit on message storage is the memory of the machine running the broker.

Tool Default Where data lives What to change
Azure IoT Edge (edgeHub) TTL of 7,200 seconds Container filesystem Raise timeToLiveSecs, mount dedicated host storage
Telegraf 10,000 metrics per output, oldest overwritten RAM buffer_strategy = "disk" plus buffer_directory
Mosquitto 1,000 QoS 1/2 messages per client RAM, persistence off Enable persistence, publish at QoS 1
Greengrass stream manager Policy set by you Local disk, unencrypted Set size, retention and priority; enable full-disk encryption

Do the arithmetic before signing off

Take a hypothetical line with 200 sensors, each sending one value per second, so the gateway receives 200 metrics per second. The plant’s IT team says the longest outage last year was 8 hours, or 28,800 seconds.

With Telegraf’s defaults, 10,000 metrics divided by 200 metrics per second gives 50 seconds. Less than a minute into an outage, the buffer starts overwriting. With Mosquitto, if the receiving client goes offline, the 1,000-message queue holds just 5 seconds at that rate.

With edgeHub, a two-hour TTL means each message can wait at most two hours: when the network returns after 8 hours, only the last two hours or so before reconnection survive, and the oldest six hours have expired.

Now work backwards. Eight hours at 200 metrics per second is 5,760,000 metrics. Assume each message is about 200 bytes once packaged (measure this on the client’s real data), and the total is roughly 1.15 GB.

So timeToLiveSecs must be at least 28,800, plus a safety margin. The buffer disk also needs several times that figure, because the next outage may be longer than the last.

The calculation takes a few lines but changes the conversation with the client. Instead of a vague promise that “there is store-and-forward”, you can say: “the system holds 24 hours of data, three times your longest outage.”

Step by step at the plant

First, ask for the outage history: the longest one, how often they happen, and whether there are scheduled maintenance windows on the link. This is a discovery question, to be asked before you write the first line of configuration.

Next, trace the path of a single sensor value through every layer: sensor, broker, collection agent, edge runtime, cloud. For every layer with a buffer, answer the three questions above.

Among the layers upstream of the break, the one with the smallest buffer sets how many hours of data you keep; buffers downstream of the break, such as on the cloud side, cannot rescue messages that never got through.

Then change the configuration. Move buffers to disk. On Azure, Microsoft recommends dedicated storage on the host for edgeHub rather than the container filesystem. Switch publishing to QoS 1. If you use Greengrass, set priorities so that critical data, such as safety alerts, is exported to the cloud ahead of everything else when the network returns.

Finally, test by pulling a real network cable for longer than the old TTL, then count. The number of messages sent must match the number that arrive, and the order must be correct.

Common mistakes

The most common mistake is trusting the words “offline indefinitely” and forgetting TTL. The second is sensors publishing at QoS 0 because it is fast and light, when a standards-compliant broker will not queue those messages. The third is leaving the buffer in the container filesystem.

Microsoft says only that dedicated host storage is more reliable when offline. The practical reading of that advice: if the queue lives in the container filesystem and the container is rebuilt, the queue is very likely lost with it.

Two mistakes are subtler. One is turning off buffer_disk_sync for speed without recording the trade-off for the client.

The other is forgetting that data waiting on disk also needs protecting: AWS states that Greengrass does not encrypt locally stored stream data, relying instead on file permissions and full-disk encryption, if enabled.

For sensitive production data, that belongs as a line on the security checklist.

Turn the cable-pull test into a line on your CV

“Integrated MQTT” is a line anyone can write. “Designed an edge buffer holding 24 hours of data, verified with an 8-hour network-cut test, zero messages lost” is a line that shows you know how to measure.

When reading job postings, watch for words such as edge, OT, IIoT and intermittent connectivity. When you see them, have an answer ready for where the data goes when the network drops, along with a buffer calculation like the one above.

Many gaps in a client’s charts trace back to installation day, to a default value nobody went back and read. Be the one who reads it before the first incident.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
6 sources
Read next on the roadmap · Stage 5: DeploymentA SKILL.md file can run shell commands before Claude reads itBefore an Agent Skill reaches a client's machine, an FDE should review the whole folder, scripts and permissions included, as strictly as a pull request.