NCache 4.4 - Online Documentation

Overview

 
Distributed caching is the main need in this technological era where large scale multi-tier applications are built to cater millions of clients for high performance and scalability. But applications that require data changes rapidly demand synchronization of caches and client with the same pace. With synchronization of cache, it is also needed that all clients can share information related to some specific data set whenever any change occur in it.
 
Continuous query is provided by NCache for runtime monitoring and tracking of data related to observable data set. For example, if there is a web application regarding stock exchange where stock values will change frequently for any company.
 
The application’s clients will only be interested in the companies where they have shares. The query criteria for clients having shares in some companies are maintained and data related to only those companies should be updated on each clients view. In runtime applications, data addition is also runtime and there is no way of knowing when a specific query related data will be inserted in cache. For this, the client  can register his/her query prior to data additions and when any cached item fulfilling the query criteria is added in cache, clients will be notified automatically.
 
NCache allows the user to specify any query criteria for indexed classes.
 
Changes in result set of a query can be triggered by:
 
  • Add: Adding an item in cache or updating any existing item that can add that item in any query.
 
  • Update: Updating any existing cache item but it remains in query result set.
 
  • Remove: Removing item from cache or updating any existing cached item that causes the removal of that item from query result set.
 
Filters can be specified for notifications that your cache client will receive. Filters are basically for the amount of modified cached item related data that  will be received in  query notifications. NCache provides three types of filters as mentioned below.
 
  • None (minimum data, i.e., only key)
  • Metadata (key with meta data related to cached item)
  • Data with metadata (key with complete cached and related data)
 
If any cached item related to result set of any registered query is removed due to  expiration, eviction or dependencies then its notification will be sent to interested cache clients.
 
GROUP BY and Tags are not supported in this feature.
 
 
There might be an application that has .NET and Java clients. By enabling data sharing feature on the cluster cache, same objects can be indexed for both clients with even the same query. Notification will be sent to each client irrespective of Java or .NET for cached items added, updated or removed by both clients in any registered query result set. For example there might be an index defined for ProductID in .NET and productId in Java client. Data sharing feature was enabled between these clients and both were mapped for the same values. SELECT Product WHERE this.ProductID < 50 is registered in .NET client and SELECT Product WHERE this.productId < 50 is registered by Java client with notifications. Only one query observer will be started for both queries because both are registered for the same observable data set. Now if any item is added in cache from any of client that fulfils this query criterion, then both clients will be notified.
 
 
See Also