Comparison
Historian or SQL database for discrete part-driven data
Short answer
For acquisition triggered once per cycle — 15,000 words per machine, one part per minute, ten machines — write a triggered SQL record keyed by machine and cycle number; a tag historian keyed by tag and time does not return a complete, synchronized part record without extra work. Verify snapshot consistency with a counter read before and after each acquisition, and add a historian only for continuous troubleshooting data between cycles.
On this page
For a line that produces parts — one cycle per machine per minute, acquisition started by a counter increment, 15,000 words per cycle — write a triggered SQL record keyed by machine and cycle number. A tag historian stores timestamped values of individual tags, so a query returns one parameter's history, not one complete synchronized part record; making it serve part retrieval means reconstructing the record across tags and rebuilding ordered profiles after the fact. The throughput is modest: 30,000 bytes per machine cycle, 5,000 bytes per second averaged across ten machines. What decides data quality is snapshot consistency at the PLC, verified with a counter read before and after each acquisition — not database speed.
What each store is keyed on #
A tag historian is built around tag and time: it writes timestamped values of individual tags into tables it creates and manages itself, and depending on configuration it records periodically, on change, or under compression rules such as a deadband. That serves continuous trends well. It does not hand back "every parameter for cycle 41873" as one object; the client assembles that from many tag series.
A triggered SQL write is built around the manufacturing event: one insert set per cycle, connecting measurements, setpoints, profile samples, product identity, and the limits that applied to that part. Cross-machine analysis becomes plain SQL joins. In Ignition deployments these are the same two paths compared in Tag Historian versus transaction groups; the table below is the vendor-neutral version.
| What the plant needs | Tag historian | Triggered SQL write |
|---|---|---|
| Organizing key | Tag and timestamp | Machine and cycle number |
| Every parameter for one selected cycle | Assembled from many per-tag queries | One query on the cycle key |
| Profiles of 500 consecutive tags | Many tag series; order rebuilt from tag naming | Child rows with a sample index; order is data |
| One parameter across successive parts | Native | One query, cycle as the axis |
| Cross-machine data mining | Through the historian's own query API | Plain SQL joins across machines |
| Signal behavior between parts | Native | Not covered |
| Every collected word stored verbatim | Compression and deadband can skip values | Stored as read |
The throughput arithmetic #
Work the initial configuration before buying anything. The words are 16-bit:
- Per machine cycle: 15,000 words x 2 bytes/word = 30,000 bytes.
- Ten machines at one cycle per minute: 10 x 30,000 bytes = 300,000 bytes per minute of production.
- Average rate: 300,000 bytes / 60 s = 5,000 bytes per second.
- Burst: machines that finish together put the same minute's 300,000 bytes into a few seconds; against the 10-second collection tolerance that is 300,000 / 10 = 30,000 bytes per second while it lasts.
- Storage: 300,000 bytes/min x 60 min = 18 MB per hour, 432 MB per day — about 158 GB of raw words accumulated over a full year of production.
These figures are the raw word payload. Identifiers, timestamps, quality codes, protocol overhead, indexes, row overhead and backups all add on top.
Decision: 5,000 bytes per second average is an ordinary insert load — any server-class SQL host on a gigabit plant network carries it. Size the collector and the commit path for the 30,000-bytes-per-second burst and benchmark the coincident case, because the average never occurs on its own.
Snapshot consistency decides record quality #
OPC DA is a Windows-based standard that defines how client applications request and receive real-time process data, and in OPC UA the Read service reads attributes of one or more nodes. In both cases a successful read proves values were delivered — it does not prove that the values returned for different tags belong to the same machine cycle. Client polling and PLC execution run independently, so a trigger change can reach the collector before every associated item has refreshed in the cache.
The check that catches most of it: read the cycle counter immediately before and after the data read. If it changed, the dataset mixes two cycles — discard and read again. That check is necessary but not sufficient, because counter stability does not prove that cached items refreshed after the trigger. The robust arrangement is a capture sequence agreed with the PLC program:
- The PLC raises an event that means the cycle dataset is complete and ready.
- The dataset is held stable while the collector reads it — a snapshot buffer, or an explicit ownership-and-acknowledge arrangement.
- The cycle number travels with the dataset, never through a separate later lookup.
- Quality and completeness are checked — expected versus stored sample counts — before the cycle is accepted.
- The collector acknowledges and releases the snapshot, and a unique constraint on machine and cycle makes a retried write idempotent instead of a duplicate.
If a cycle record feeds quality release, a short profile must fail closed: reject the cycle rather than publish it incomplete.
| Symptom on the floor | Cause to investigate | Check that settles it |
|---|---|---|
| One record holds values from two cycles | Sources updated mid-read | Counter differs before and after; discard, re-read |
| A produced part has no record | Counter change missed, or dataset overwritten | Counter progression versus stored cycle numbers |
| The same cycle appears twice | A retry repeated an accepted write | Unique constraint on machine and cycle |
| A profile is short of its 500 samples | Partial read or partial commit | Stored versus expected sample count before publishing |
| Operator sees the prior cycle after a trigger | Acquisition read a stale cache | Item quality and timestamps; read sequencing |
Splitting 15,000 parameters across tables #
One column per tag is the wrong default at this width. Database engines cap the columns a table may hold, and a table thousands of columns wide cannot be extended or queried sanely. Split by stable engineering meaning instead:
- A cycle header row per part: machine, cycle number, production timestamp, product identity, and the limits set in force.
- Scalar parameters grouped into tables of related signals, each fragment still carrying machine and cycle so one join rebuilds the whole part.
- Profiles as child rows — machine, cycle, profile identifier, sample index, value — so a 500-point pressure profile is 500 ordered rows and the ordering is data, not a tag-naming convention.
- Per-parameter warning and alarm limits in a reference table joined at display time, not copied into every cycle row.
Where the collector runs #
Keep a collector at each machine or pair, as the plant does today: a fanless mini PC in the cabinet reads the snapshot, verifies the counter and the sample counts, and forwards the finished cycle to the central SQL server. Store-and-forward on the collector covers plant-network outages — the buffering pattern laid out in choosing an edge data path for periodic records — so a link outage delays a record but never costs a produced part.
When a historian still earns its place #
Add a historian when someone must see what the signals did between completed parts: pressure, temperature or machine state in the minutes around a rejected part, at a cadence part records do not carry. Then run both stores — triggered SQL for the part records, the historian for continuous context. For Ignition sites, the storage trade-offs of that split are worked through in Tag Historian versus SQL Bridge storage for a short-term trend database.
The decision #
- The operator's unit of work is one produced part: triggered SQL keyed by machine and cycle number, built with the capture sequence above.
- Analysis is one parameter across many parts: same store — query with cycle as the x-axis and production time as a column.
- You must investigate behavior between parts: add a historian alongside the SQL store, never instead of it.
- Part records alone satisfy the requirement: skip the historian. Adding one by default buys compression rules you will spend effort defeating.
The later plant with 30 machines ranging from 100 to 10,000 tags stays on the same path; size it from the actual machine inventory, not by multiplying every machine by the maximum tag count.
Questions asked
Does a historian lose data when it compresses?
Historians typically log on change or within a deadband, so unchanged or in-tolerance values can be skipped between logged points. That is desirable for trends and wrong for a part record that must carry every word collected for that cycle. A triggered SQL insert stores all 15,000 words verbatim, which is why the part record belongs there.
Our plant may grow to 30 machines with 100 to 10,000 tags each. Does the choice change?
No. The worst case is 30 machines x 10,000 words x 2 bytes = 600,000 bytes per minute, an average of 10,000 bytes per second, still an ordinary insert load for a central SQL server. Size it from the actual machine inventory rather than multiplying every machine by the maximum tag count, and re-benchmark the burst whenever several machines share a cycle time.
Is the 10-second collection window a risk?
Not at these rates. Ten seconds of a 60-second cycle leaves ample margin against a 5,000-byte-per-second average. The real risk inside that window is the PLC overwriting the dataset before a retry completes, so hold the snapshot stable until the collector acknowledges it. The tolerance buys batching time, not safety against reading changing data.
Can we still graph parameters against time if data is stored by cycle?
Yes. Production time is a column in the cycle header, so a query can order or filter by time while every plotted point still resolves to one specific produced part. That is exactly what operators on a discrete line expect when they trend against time: each point on the graph means a part.
Do we still need local collection PCs in front of the central server?
Keep one collector per machine or pair for the snapshot and counter check, but watch the store-and-forward buffer as a monitored point: at 30,000 bytes per cycle a full day of plant-network outage is under half a gigabyte per machine, so alarm on buffer age or depth, not disk space, and treat a collector that stops acknowledging snapshots as a line stop — the PLC buffer is the first thing to overflow.