Many applications today need to share data with each other at runtime asynchronously. And relational databases do not provide an efficient event notification mechanism. Hence their performance and scalability is a major concern.
NCache is an extremely fast and scalable in-memory distributed cache and also provides a simple and powerful Data Sharing Features with Notifications.
NCache features event driven fetching of data whenever the data in cache is modified. This allows client applications to receive data without any explicit data fetch request to the cache server. Events work on push mechanism for whenever there is some activity of interest takes place in cache, it publishes events to its subscribed clients. This allows runtime data sharing of single cache shared by separate applications or separate modules of same application.
Events enable NCache to notify client application if something of interest occurs. Events in NCache follow publisher subscriber model where cache is the publisher and client application is the subscriber.
Events have the following properties:
-
The publisher determines when an event is raised; the subscribers determine what action is taken in response to the event.
-
An event can have multiple subscribers. A subscriber can handle multiple events from multiple publishers.
-
Events are typically used to signal common cache operations like Add, Insert, Remove, Delete and Cache Cleared.
Types of Notifications
Add notification is triggered when a new item is added to the cache. All applications who have registered this event will receive a notification when data is added to the cache.
Update notification is triggered when an existing item is updated in the cache. All applications who have registered this event will receive a notification when data is updated in the cache.
Remove notification is triggered when an item is removed from the cache. All applications who have registered this event will receive a notification when data is removed from the cache.
Cache Clear notification is triggered when cache is cleared. All applications who have registered this event will receive a notification when cache is cleared.
Levels of Events by NCache
NCache provides the following level of events:
NCache can notify clients on add, insert, and remove of any item in the cache or if the cache is cleared, if the client has registered interest in receiving such events.
NCache can notify clients on a specific item update and remove if the client has registered interest in it.
NCache can monitor a dataset in the cache based on SQL-like criteria and then notify clients for add, update, and remove of items from this data set to clients who have registered interest in it.
Applications can fire custom events into NCache so other applications who have registered interest in them can be notified.
See Also