This solution offers real-time and historical analytics, and it also allows for analytics on a private/public cloud with external interfaces from long-term data store on SDP. This section describes the approaches for on-premise analytics on Litmus and SDP. The next section will cover the external data access from SDP for cloud-based analytics.
Real-time analytics and storing data locally on Litmus
The Litmus Analytics Flows Manager provides real-time analytics on ingested data topics, and the results can then be stored on the local data provider on Litmus for a limited retention period. To do so, start with Litmus Edge > Analytics and select the data flow topics and expressions to execute on the topic and the database where you with to publish the results.
The following figures show the flows defined to run the real-time analytics where results get published to the local data provider on Litmus Edge. It uses the Unit Conversion process to convert temperature from Celsius to Fahrenheit units. The analytics results are stored in the Litmus Edge database table. Each Flow node in the configuration is shown in the following figures.
Flow-Node 1 polls the database for the specified metric name from the database. Filtering can also be done using InfluxDB queries.
Flow-Node 2 performs analytics on the value retrieved.
Flow-Node 3 publishes the results on InfluxDB under a different measurement.
Real-time analytics and publishing to Litmus and SDP
Litmus Analytics Flows Manager provides real-time analytics on ingested data topics, and the results can be stored on the local data provider on Litmus for a limited retention period and published to SDP for long-term retention. To do so, start with Litmus Edge > Analytics and select the data flow topics and expressions to execute on the topic and select both Litmus Edge database and SDP for published results.
The following figures show the flows defined to run the real-time analytics where results get published to the local data provider on Litmus Edge. It uses the Unit Conversion process to convert temperature from Celsius to Fahrenheit units. The analytics results are stored in both Litmus Edge and SDP database tables. Each Flow node in the configuration is shown in the following figures.
Flow-Node 1 reads the real-time stream data from the device topic.
Flow-Node 2 performs analytics on the ingested data.
Flow-Node 3 stores the data on a Litmus Edge-based database, similar the prior use case, and stores the measurement locally on InfluxDB. It also publishes to another analytics topic, which can then ingest the result to SDP for persistence.
Real-time/historical analytics with SDP-based data on a Marketplace container
As described earlier, all ingested data is also stored on SDP, so in order to combine real-time and historical data-based analytics, use a container service running on Litmus Edge or leveraged from Litmus Marketplace. This container service pulls data from SDP, runs the analytics on the container on Litmus Edge, and then publishes the results to Litmus Edge for a limited retention period and also publishes to SDP for long-term retention.
Note: As Litmus Edge stores the data locally for a limited period (typically seven days or 1,000 hours) based on the local available and configured storage capacity, this use case can also be done by developing complex queries that use data sets on Litmus and then join that with older data sets from SDP for combined analytics. This is out of the scope of this document, and therefore it is not described in this document but noted here as a reference.
To combine real-time and historical analytics, perform the following steps.
Create a Node-RED container service on Litmus Edge Marketplace, or select an existing one from the Marketplace catalog. The container TAR file can also be uploaded to start the container service.
Populate the container with NatsIO and SDP data sink specific modules (InfluxDB or PostgreSQL for TimescaleDB). This requires internet connectivity to download the modules.
Develop the flow to perform queries on the database on SDP. The InfluxDB node can be used to specify the query and the nats-pub node can be used to publish the results to Litmus Edge for further analytics.
The following figure is an example of an InfluxDB node configuration with the sample query. Use the URL for the InfluxDB sink configured on SDP to query InfluxDB. Use the select statement with the table format <project/stream> to query a specific Pravega project and stream on SDP.