EJB design: WAS 3.5 and Clone Problem
I am having one scnerio here which goes like this.
I am planning to enhance one functionality in my application. I will explain it in little detail to get the best possible solution:-
I am having Websphere Application Server 3.5 and having two clone. Clone is noting but request handler which is used for request processing. (We are having 2 clones which fulfill the purpose of load balancing in my case. BOth of them are running on different machine)
Application Server gets the request and sends that to the available Clone to process it. Clone gets the request and processes it.
Clone will go to the backend and fetch the data for the same request and keep this in its cache. So whenever request is coming to clone then it will first check whether it is having the data for that request in cache or not.
If it is having the data then it will make use of that otherwise it will go to back end and fetch the data. This data remains in its cache for the specified time interval which configurable.
If in the mean time App server get the same request and this time it assign to different clone to process it then it will do the same processing once again and store the data in its own cache. So we are having data in both the caches. We do not want this due to performance issue.
We want to check for every request whether data is available in any cache or not ?
I hope requirement is clear now:::--
I am having one suggestion for this --- To have an EJB which will wrapper to clone. So it will check first if data is not there in its cache then it will make a call to another EJB which will remote for this EJB.
So it is like this now:
Now whenever clone will get the request then it will send the same to EJB. EJB will check in its cache and if data is not there in its cache then it will make a call to EJB of the clone2 and check if that data is present there or not.
If that is not present then it will fetch the data from backend.
Now clue here is -- We will have the same EJB on both the server. I mean we will have the same name and same methods in both of them (But running on different machine).
But i am not sure whether we can make a call like this or not ?? I am also not sure whether this the best way to do it.
Do you guys having any suggestion for the same ?
If you can suggest any better way then please let me know.We can increase number of clones in future. So please keep that also in mind.
I think you would benefit from taking a look at Coherence's Replicated Cache. The Replicated Cache keeps a concurrent "snapshot" of the entire cache on each machine. So when you are on Clone1 and you retrieve the data and place it in the Replicated Cache that data will be available on Clone2 as well. Our caches also have configurable eviction policies as well as the ability to plugin custom eviciton policies if that is warranted.
Tangosol Coherence: Cluster your Work. Work your Cluster.