Comparison
Historian-like data logging on a restricted edge network
Short answer
On a restricted plant network the approved destination decides the architecture: write directly from Node-RED to the database when that connection is approved, publish MQTT and land it in InfluxDB with Telegraf when only a broker is approved, and capture to local files when nothing outbound is allowed. Whatever the path, prove store-and-forward with an outage test sized from your tag count and write period.
On this page
On a restricted plant network, the approved destination decides the logging architecture, so choose it before you open any tool. If the network team will approve a connection from the edge node to the database, write directly from Node-RED and skip every middle layer. If only an MQTT broker is approved, publish from the node and land the data in InfluxDB with Telegraf. If nothing outbound is approved, capture to local files sized to the outage the node must survive. Those three answers cover the decision. The rest of this article compares the paths, sizes the local buffer with a worked example, and gives the outage test that proves buffering before you trust it — buffering is the part engineers assume and plants regret.
The approved destination decides the architecture #
Ask the network owner exactly one question: which outbound connections may this edge node open, to which host and port? A generic request to log data invites a flat no; a named host and port gets a real answer. Three answers cover every restricted plant network.
- A database host and port are approved. Write straight from the flow engine to that database. It is the shortest pipeline: the node formats the value and writes the record, with no broker and no middleware to run or license.
- Only a broker is approved. Publish MQTT from the node, subscribe with Telegraf on the store side, and write into InfluxDB. This layout scales: nodes are added without touching the store, and the same MQTT input feeds 40+ Telegraf output plugins, so the destination can change without reworking the nodes.
- Nothing outbound is approved. Capture to local files on the node. The data stops there until someone approves a path out — size the disk with the worked example below, and define rotation before the first outage rather than after it.
Do not build on a connection you do not hold in writing. A flow engine reaches a database in a five-minute demo; that proves the code works and proves nothing about what the firewall allows in production. Get the destination approved first, and the tool choice follows in an afternoon. If the records are periodic rather than event-driven, the same question frames the whole design, and the trade-offs are laid out in choosing an edge data path for periodic records.
The three paths compared #
| Data path | What the network team approves | Fits when | Outage behavior to prove |
|---|---|---|---|
| Flow engine writes straight to the database | One outbound connection from the edge node to the database host and port | One or two nodes, one store, no extra services wanted | Every write retries after the link returns, and points carry their original timestamps |
| MQTT published from the node, Telegraf writes InfluxDB | One outbound connection from each node to the broker | Many nodes converge on one store, or collection must scale | The broker queues or the node buffers, and the backfill lands once with source timestamps |
| Local file capture on the edge node | Nothing outbound; local write access to the node's own disk | No connection to a store can be authorized | Rotation works, the sized buffer fits, and files survive a node restart |
Direct write. The first symptom of trouble is the flow engine's write error when the link drops; what retry and reconnect behavior should look like after an outage is covered in fixing Node-RED InfluxDB write errors after a network outage. The risk to test: while the link is down, unwritten messages sit in the flow engine's memory, so a long outage can exhaust the node before the network comes back.
MQTT plus Telegraf. Whether the broker queues messages for your subscriber during an outage depends on the broker's session configuration, and whether the subscriber replays them depends on Telegraf's — which is why backfill after reconnection is its own test, covered in MQTT store and forward backfill after a connection outage. Settle measurement names, tags and fields before adding nodes, because collection scales on the config and schema, not on the hardware. Keep the InfluxDB data directory on local disk at the store host: InfluxDB on a network share is a known source of lock faults, walked through in fixing InfluxDB database is locked on a network share.
Local file capture. It needs no approval beyond write access to the node's own disk, which is why it is the only option when nothing outbound is allowed. It buys time, not a historian: define rotation, size the disk, and specify the export path that will carry the files out once a connection is approved.
Example: sizing the buffer for an 8-hour outage at a 5-second scan #
The inputs below are the worked case — a typical single-line node, stated so you can substitute your own numbers:
- Tag count: 100, one production line published by one edge node.
- Write period: 5 s per tag.
- Outage window to survive: 8 h, one shift without the approved link.
- Point size: about 100 bytes per line-protocol point for a compact schema (measurement, tag set, field, timestamp). This is a planning estimate; wide tag sets run larger.
- Margin: 10×, covering indexes, retries and schema growth.
The rule in words: buffered points equal tags multiplied by outage seconds divided by period seconds; buffered bytes equal buffered points times bytes per point; provision the margin on top.
The arithmetic:
- Outage in seconds: 8 h × 3600 s/h = 28,800 s.
- Points per tag: 28,800 s ÷ 5 s = 5,760 points.
- Total points: 5,760 × 100 tags = 576,000 points.
- Raw size: 576,000 points × 100 B = 57,600,000 B ≈ 58 MB.
- With margin: 58 MB × 10 = 580 MB.
The result: about 580 MB of buffered data for the shift, provisioned as 1 GB. The decision: give the buffer 1 GB of free disk in this case. The figure scales linearly — 200 tags, or a 2.5 s period, doubles it to 2 GB. One shift of outage at this rate sits comfortably inside ordinary edge storage, so disk is not the binding constraint; the approved outage window is. When the buffering node is new hardware rather than an existing box, pick it for that disk budget first: a fanless industrial mini PC with local storage sized to the buffer covers this class of node.
Prove store-and-forward with an acceptance test #
Buffering is a configuration outcome, not a default to trust: whether the broker queues for an offline subscriber, whether Telegraf replays, whether the flow engine retries — each is set somewhere, and each can be off. Prove the whole path with one test before the system is trusted.
- Baseline. Run the path normally and change one known tag. Connection, schema provisioning and a confirmed write are three separate milestones, and only the third is storage, so confirm the new value lands against its original timestamp.
- Break. Take the approved link down for the full sized window — the 8 h of the example, or your own number — while values keep changing at the source.
- Restore. Bring the link back and confirm every buffered point arrives once, keyed to its source timestamp. A reconnect that re-stamps history to the reconnect time fails the test.
- Count. The points stored across the window should match the buffer arithmetic from the example within a stated tolerance, and what counts as stored is defined in when store-and-forward data counts as stored in the historian.
One boundary stays fixed whichever path wins: this pipeline copies process values for history and never carries a signal a safety function depends on — safety signals keep to the safety system's own approved route.
The decision for each case #
- Database connection approved: write direct from the flow engine. One hop, one place to test, and no middleware until a second requirement justifies it.
- Only a broker approved, or several nodes to consolidate: publish MQTT and land the stream in InfluxDB with Telegraf; the full store setup is step-by-step in how to store MQTT messages in InfluxDB with Telegraf. Settle the schema before the second node joins, then scale.
- Nothing outbound approved: local file capture, sized by the example, rotation defined, export path specified for the day an approval arrives, and recovery from a node restart proven.
Destination first, pipeline second, acceptance test always: on a restricted network the approval decides the architecture, and the outage test decides whether to trust it.
Questions asked
Do the Node-RED InfluxDB nodes support InfluxDB 2?
The documented node-red-contrib-influxdb package supports InfluxDB versions 1.x through 2.0, so the same flow engine writes either a 1.x database or a 2.x instance. Mind the schema change: a 2.x write targets a bucket rather than a database name, so configure the node for the version actually deployed, confirm one write lands with a known value and timestamp, and only then scale the flow.
Can operators get dashboards without widening the network?
Yes. Put the visualization server where an approved read path to the store already exists: Grafana queries InfluxDB for its dashboards, so operators read history without any new inbound connection into the restricted zone. If the store itself sits inside the restricted zone, approve one read-only path for the visualization server and leave every write path exactly as it is.
What fails first when the local buffer is undersized?
Disk fills first. The node fills its buffer partway through the outage, writes start failing, and the remaining points are lost permanently because they were never stored, so no reconnect can recover them. Run the acceptance test for the full sized window, not a token five minutes: an undersized buffer passes a short test and fails a shift. If the window grows, re-run the sizing arithmetic before extending it.
Does a single edge node still need an MQTT broker?
No. When the network team approves a direct connection to the database, a single node writes straight from the flow engine, and a broker would add one more service to run, secure and approve for no benefit. A broker earns its place when several nodes converge on one store, when collection must scale, or when the only outbound destination the network team will approve is a broker.