Skip to main content

Continuous Queries Overview

A key feature of ActivePivot is its support for Continuous Queries.

Continuous queries are "normal" ActivePivot queries, but instead of just making a query and getting the result at a given instant, they are refreshed when data changes.

Continuous queries are registered to ActivePivot together with their listeners. When the values of the measures defined in the registered query change because of a transaction or a real-time event, the listeners are notified of this change and receive the new aggregated values.

Registering Continuous Queries

For most usages, continuous queries are registered via the Streaming API. In some advanced use cases, you can register locally (within the same JVM as the running ActivePivot server) within location-based continuous queries.

Measures and Handlers Configuration

For listeners to be notified whenever a measure value changes, without recomputing all the queries any time something happens, the continuous query engine must be aware of which events can trigger a value change for a given query.

This is the job of the Aggregates Continuous Handlers.

Continuous Query Engine Configuration

The Continuous Query Engine is responsible for calling the handlers to check if a query can be impacted by an event, then recomputing the relevant measure values for the registered continuous queries and notifying the listeners.

ActivePivot offers various implementations of Continuous Query Engines to best fit different performance and feature use cases.