Skip to content

Datum Historian

SolarNode includes support for preserving a history of the datum generated by Datum Sources. This history can be used by expressions, for example. Another use case is to support site-local applications that want to visualize the data collected by SolarNode, such as a factory HMI device. For that scenario, the datum REST API can be used by the HMI to access the datum history, using the same SolarQuery API used to access datum from the SolarNetwork cloud.

Default Historian

The default historian in SolarNode maintains only the 5 most recent datum generated per source ID, since SolarNode started (it does not preserve the histor across application restarts). The default historian does not support the datum REST API, however. Deploy the Database historian if you need that support.

Database Historian

The JDBC Datum Historian plugin supports preserving datum in a Postgres database, limited only by the storage constraints of the Postgres cluster. The Postgres cluster can be the same cluster SolarNode uses for its internal database, or an external cluster hosted anywhere SolarNode can connect to.

Info

The Database Historian is provided by the JDBC Datum Historian plugin, which is provided by the solarnode-app-datumhistorian-jdbc package in SolarNodeOS.

Aggregates

The Database Historian can also store FifteenMinute, Hour, Day, and Month aggregates of every datum stream, for the aggregated results of the datum REST API, which also combines the 15 minute aggregates into ThirtyMinute ones and computes FiveMinute and TenMinute ones from the datum when queried. This is the historian's aggregate setup, which is chosen when the database is set up, as the JDBC Datum Historian plugin's README describes. A scheduled database job keeps the aggregates up to date as datum are stored.

15 minute aggregates start on the quarter hours in UTC, and are computed with the hour they are part of, so they add up to it. Hourly aggregates start on the hour in UTC, and daily and monthly aggregates at midnight in the node's time zone. The 15 minute and hourly aggregates are kept in tables partitioned by UTC year, which manage their own partitions: the partition of a year is created when the first hour in that year is stored, which can be a past year when a late datum arrives. Partitions are never dropped automatically, so the aggregates are kept for as long as the database is.