Queries with Zero Latency
Continuous Query Cache maintains the result of your filtered queries that you perform on a Hazelcast Map. You can think of it as a queried Hazelcast Map which is local to your application. Along with the query result, this cache gets a continuous stream of events generated by the changes within your map. By this way, the cache offers always up-to-date query results in a real-time manner, meaning that your queries on the map will have a zero latency.
You don’t need to run any distributed queries on your cluster to get the desired data; relevant data will come to your application local automatically. All operations on the Continuous Query Cache are performed locally like a
java.util.concurrent.ConcurrentHashMap, so it is fast.
Since it maintains an up-to-date local copy of a specified subset of your distributed map, Continuous Query Cache is beneficial in a lot of applications whether they are server or client based.
- For the applications that involve repeated queries and that require instant access to the query results.
- As a way to access and use the query results using NamedCache API.
- As an entity similar to a Near Cache since it has an up-to-date set of data local to your Hazelcast member or client. The difference is that a Near Cache is based on invalidation, but Continuous Query Cache maintains always current data.
- As a building block for complex event processing systems.
- Access either from a Hazelcast member or a client.
- Run queries with indexes.
- Perform event batching and event coalescing.
- Specify a maximum size so that the entries can be evicted.
- Listen to events using Hazelcast’s map listener.
- Get streaming events in the same order as they are generated on the map entries.