We are having an all active node cluster where each node can receive requests for reading data and is expected to return identical data all the time. Now there is a requirement to introduce a caching framework which should fit into our architecture without changing the current design.
While we investigate Jboss cache arhictecture, we understand that it provides in-memory cache but also persistense based on some configurations with eviction and class loading. This suits our need of using eviction for the efficient use of memory and persisting only on memory overload. But we are having a requirement on deleting the cached data (permanetly) on its expiry. We may have to impelement a supplementary feature to implement this and this is not the issue.
We are evaluating the different cache loading techniques like shared class loaders, class loaders with each node having its own persistent store etc. But as made clear earlier, we also need to combine eviction along with class loading as we need to make best use of memory. Our concern is selecting the best class loading technique which suits our architecture.
A) If shared class loading is used,
if the object is evicted at different intervals from the different nodes of the cluster, whether the object passivated from node will be overwriiten from the other node ? But is this ok as the objects evicted/passivated are all same across the nodes due to replication ( used with synchronous option)
If one node is restarted, should it load the state from other node because it cant just rely on the persistent store as the other node can be ahead of the persistent store.
B) If we use different persistent stores for each node,
If the objects are evicted at different intervals from the different nodes of the cluster, we can assume that the objects will go into separate persistence stores. But again if a node is restarted, it has to load the entire state from the memory of other node and not its persistence store as the memory always has the actual data if used with eviction ?
If the persistent store one node is down, what happen to the requests on that node. Whether the object is automatically loaded from other nodes and returned back as well as updating the local cache?
Also one more concern is on the concurrent writes to the same object across the cluster. We understand that Jboss cache supports 2 phase commit, where the object is locked for writes on other nodes while it is being done on some node.
Please provide us some inputs at the earliest as it is URGENT.