Introduction
Using Cumulocity Streaming Analytics, you can add your own logic to your IoT solution for immediate processing of incoming data from devices or other data sources. This logic can, for example, alert applications of new incoming data, create new data based on the received data (such as sending an alarm when a threshold for a sensor is exceeded), or trigger operations on devices.
Typical real-time analytics use cases include:
- Remote control: Turn a device off if its temperature rises over 40 degrees.
- Validation: Discard negative meter readings or meter readings that are lower than the previous.
- Derived data: Calculate the volume of sales transactions per vending machine per day.
- Aggregation: Sum up the sales of vending machines for a customer per day.
- Notifications: Send me an email if there is a power outage in one of my machines.
- Compression: Store location updates of all cars only once every five minutes (but still send real-time data for the car that I am looking at to the user interface).
Cumulocity Streaming Analytics includes a built-in event processing engine that powers both Analytics Builder and custom EPL (Event Processing Language) apps. This engine, called the Apama correlator, runs automatically within the Cumulocity platform and does not require manual setup or management.
Streaming Analytics is available in both Cumulocity Core (cloud) and Cumulocity Edge (local installation), providing flexibility for different deployment needs.
Understanding processing modes in Streaming Analytics
When working with Streaming Analytics in Cumulocity, the availability and persistence of data depend on the processing mode chosen at ingestion. Refer to HTTP usage > Processing mode in the Cumulocity OpenAPI Specification and OPC UA > Sample payloads for more information.
This directly impacts what data you can access, analyze, and act upon in realtime.
PERSISTENT (default) and QUIESCENT modes:
Data is stored in the Cumulocity database and sent to the Streaming Analytics engine. This is the normal expectation where all data is persisted in the platform before Streaming Analytics processes it.
TRANSIENT and CEP modes:
Data is sent to the Streaming Analytics engine, but it is not stored in the database. This allows processing of data before it’s stored in the platform to reduce storage with aggregates or to do data conversion or cleaning tasks before it is stored in the database.
PERSISTENT and TRANSIENT modes also generate notifications to non-Streaming-Analytics subscribers to notifications, whereas CEP and QUIESCENT modes will only be sent to Streaming Analytics. The latter two modes are only applicable to measurements and events.