IMD SolutionComputing LibraryShop main store

Explainer

Using flat files as the Ignition tag historian back end

Edge computing and IIoT Published 7 min read

Short answer

The standard Ignition tag historian writes through JDBC to a relational database, so a flat binary store like TeaFiles needs a custom historian module. SQLite delivers a no-server file-based back end with gateway configuration only, and TimescaleDB or a third-party InfluxDB module covers the performance path.

On this page
  1. Can the Ignition tag historian write to flat binary files like TeaFiles?
  2. Why can't a JDBC connector stand in for a flat file?
  3. Which back end should you choose: SQLite, TimescaleDB or a module?
  4. How much history can a SQLite back end take?
  5. How do you point the historian at a SQLite file?
  6. How do you confirm history is landing in the file?
  7. What breaks on SQLite historian setups?
  8. Questions asked

Not with the stock module — and yes, two configuration-only routes get you a file-based store anyway. The Ignition tag historian writes through JDBC to a relational database: that is the constraint that rules out a flat binary format such as TeaFiles behind the standard module, and the reason SQLite and TimescaleDB drop in with configuration only. TeaFiles, or any store without SQL semantics, reaches the historian through a custom module that implements the historian provider itself — the route the third-party InfluxDB modules took. Decide it this way: SQLite when the requirement is one file on disk and no server, TimescaleDB when you outgrow that file, a module when throughput drives the design, and a TeaFiles build only as a development project.

Can the Ignition tag historian write to flat binary files like TeaFiles? #

No — not through the standard historian. Ignition's tag historian module turns a SQL database into a time-series store and issues its reads and writes over JDBC, so a flat binary format such as TeaFiles sits behind it only through a custom module that implements a historian provider.

The module's documented design is minimal setup: enable history on a tag, choose a provider, and the provider writes to a named database connection. Every supported path — Microsoft SQL Server, MySQL, PostgreSQL — is a relational engine reached over JDBC.

TeaFiles is the opposite shape: a file format with an API for time-stamped series, offering append and range reads rather than a query language. Proprietary high-performance historians that store this way have engines built around the format; Ignition's historian has an engine built around SQL. The two meet only inside a custom module.

The gateway documentation does include a documented connection procedure for SQLite, which is what makes the no-server file route a configuration task rather than a project.

Why can't a JDBC connector stand in for a flat file? #

Because the historian does not read records by file offset; it sends SQL — inserts, queries, and DDL that creates and partitions tables. A JDBC driver for a flat file would therefore have to be a SQL engine, a bigger project than the historian provider itself.

JDBC is an interface for drivers that execute SQL: statement parsing, query planning, transactions, catalog metadata, and the DDL the historian issues when it provisions its tables. A binary time-series file offers append and range-read primitives, not a relational layer. A connector between them would be a database with a file underneath — more work than the module it was meant to avoid.

The supported alternative is the historian provider interface in the module SDK: implement the provider against the file API directly and register it with the gateway. That is how the third-party InfluxDB historian modules work. They replace the storage engine, and tag configuration stays the same.

Which back end should you choose: SQLite, TimescaleDB or a module? #

Split it by what already speaks SQL: SQLite and TimescaleDB plug into the standard historian with configuration only, while anything without SQL semantics — TeaFiles, PI-style archives — needs a module. Commit to SQLite for a no-server file store, TimescaleDB for headroom, a module for performance.

Back end Integration path Effort Where it wins Commit when
SQLite SQLite JDBC driver plus a database connection; the provider points at it Configuration only One file on local disk, no server process The requirement is a flat file with no database server
TimescaleDB PostgreSQL-compatible, so the PostgreSQL JDBC driver connects Configuration only Time-series layout on a Postgres base, with room to grow You outgrow the single-file writer but want to stay on JDBC
Third-party InfluxDB module Module install replaces the SQL back end Module install and configuration Purpose-built time-series throughput Performance is the deciding requirement
Custom TeaFiles module Historian provider implemented through the module SDK Software development project Exactly the storage format you specify You need TeaFiles itself, as a development project

Start with SQLite: it costs gateway configuration and keeps every standard historian feature. TimescaleDB is the growth path that keeps the JDBC connection — an evaluation of Ignition historian on TimescaleDB walks the sizing questions before you stand up a Postgres host. A third-party InfluxDB module is the throughput route, installed and configured as software. A TeaFiles module is a development project you own end to end.

How much history can a SQLite back end take? #

At 345,600 records per day — 120 tags sampled every 30 seconds — commit to SQLite and stop debating. The trigger to move is sustained write contention on the file's single writer, a symptom you observe, not a row count you predict.

Worked example, with illustrative inputs: 120 tags, each historized at one sample every 30 seconds, 24 hours a day.

  • Samples per tag per day: 86,400 s ÷ 30 s = 2,880 samples
  • Records per day: 120 tags × 2,880 samples = 345,600 records
  • Records over a full year: 345,600 × 365 = 126,144,000 records

At that rate the file sits on local disk, the single writer is nowhere near saturation, and every standard historian feature works unchanged. What tells you to move is a symptom: sustained write queueing — SQLite allows one writer at a time on a database file — showing up as lagging trends and a growing backlog. When you see it, move to TimescaleDB rather than tuning SQLite.

Separate the module's floor from your data. The historian module's documented requirements list 1024 MB of RAM and 1 GB of free disk, and those cover the module itself, not history. Data volume is bounded only by pruning and retention for Ignition tag history, not by that floor.

How do you point the historian at a SQLite file? #

The whole path is gateway configuration: add the SQLite JDBC driver, create a connection pointing at a local file, create a database history provider on that connection, then enable history on the tags — no module install, no server process, no code.

  1. On the gateway webpage, open the Config section and scroll to Databases > Connections, the documented place to add a connection.
  2. If no SQLite driver is listed, add one under the gateway's database driver settings. The gateway does not bundle a driver for every database; its documentation shows installing one where it is missing.
  3. Create the connection. A SQLite JDBC URL starts with jdbc:sqlite: followed by the path to the database file — confirm the exact syntax in the installed driver's documentation, and use a local path on the gateway host.
  4. Wait for the connection status to show valid. A faulted connection leaves the historian nowhere to write.
  5. Create a database tag history provider and select the SQLite connection as its data source.
  6. On each tag, enable history and set the provider. Let the tags change value or sample so the first records are written.

How do you confirm history is landing in the file? #

Prove it with three checks in order: the database connection shows a valid status, the SQLite file at the configured path grows after historized tags change, and a trend over a recent window returns the values you watched live. All three together are the proof.

When a trend is blank, separate tag faults from binding faults from connection faults before touching anything else:

Symptom What it usually is Where to look
One tag trends empty History not enabled or provider not set on that tag Tag editor, history settings
Some tags trend, others do not Provider assignment differs between tags Each tag's history settings
No tag has data Provider points at the wrong or faulted connection Gateway history provider settings
Provider errors, connection faulted Driver missing, path invalid, or the service account cannot write Gateway database connection status

What breaks on SQLite historian setups? #

Four failure modes account for nearly everything: write contention from high tag counts or fast sampling, the file placed on a network share, missing folder rights for the gateway service account, and copies taken while the gateway writes. Each has a fix that is not moving off SQLite.

  • Write contention. One writer at a time per database file. High tag counts or fast sampling push the historian into queueing; that is the point to move to TimescaleDB or a module, not to tune SQLite.
  • Network file paths. Keep the file on local disk. File locking over network shares is unreliable for SQLite.
  • Service permissions. The gateway's service account needs write access to the folder, not just the file, because SQLite creates journal files alongside the database.
  • Backups. Copying the file while the gateway writes can capture an inconsistent state. Use a database-aware backup or stop writes during the copy — the one step that protects the history you just proved.
  • Expectations. A SQLite database is a relational store in a file, not a compact append-only archive. File size and query behavior follow the SQL model.

Questions asked

Does the historian's pruning still work on a SQLite back end?

Yes. Pruning runs as SQL against the connection, so the retention settings configured on the provider delete old rows from the file the same way they would on any database. Set retention deliberately: on a single-file store nothing else bounds growth.

Can two gateways share one SQLite history file?

No. SQLite allows one writer at a time on a database file, and file locking over a network share is unreliable even for reads. If two gateways must write the same history, put a client-server database behind them and point both history providers at it.

Is connecting Ignition to SQLite a documented procedure?

Yes. The gateway documentation walks through a SQLite connection in the Config section under Databases and Connections, and the historian treats any valid connection as a provider data source. Treat the driver's own documentation as the authority for the JDBC URL syntax.

What do you give up with a custom TeaFiles module?

You keep standard tag configuration, but you leave the SQL toolchain behind: ad-hoc queries, reporting tools, and the pruning and provider features that assume a database all become your module's job to reimplement. Budget it as software you maintain, not configuration you set once.

Keep reading

  • Comparison

    MQTT Recorder or Tag Historian for plant data

    Tag Historian stores timestamped values for individual tags in a SQL database, built for trends and time-based queries. MQTT Recorder receives a block of data from an MQTT server and inserts it as one row in a database table, built for completed field-generated records such as tickets and batch results. Choose by the unit of information, then put buffering where the link fails.

    Edge computing and IIoT

  • How-to

    Downsampling old Ignition historian data to one-minute averages

    Ignition has no built-in expiry with aggregation, so you downsample stored history yourself. Two workable patterns: a scheduled database job that keeps the first row of each 60,000 ms bucket in the old sqlt_data partitions, or a monthly gateway script that reads averages or min/max with system.tag.queryTagHistory and then deletes the raw rows. Both are irreversible deletes, so run them on a verified backup and tighten per-tag deadbands first.

    Edge computing and IIoT

  • Troubleshooting

    Edge tags unreachable after a PC replacement

    Keep the remote tag provider as it is. After an Edge PC replacement, the SecurityException on provider access traced to the MQTT Transmission module, whose entitlement did not survive the backup, license transfer and restore; reinstalling the module restored browsing from the central gateway. Confirm zones and tag-access policy first, then check module licensing before touching the provider.

    Edge computing and IIoT