Hi Ranchars,
I am developing a clustered caching services (I know there are many caching services available on the net, but I want to do it just to know what all it takes to develop such a service from scratch) so that any clustered
java applications shuld be able to put and retrieve objects from cache within its own JVM.
Clustered Cache should support following features:
(a) Client should be able to place/retrieve any object in to the cache.
(b) The application has objects that it wants to store in the cache for
different periods ranging from few minutes to hours/days
(c) The caching service has a limit on the number of objects cached. The
client application should not be affected by this limit imposed on the
cache. The cache should support
pluggable cleanup mechanisms
using algorithms like least-recently used (LRU) or least-frequently
used (LFU) etc.
(d) The caching service should ensure maximum serviceability by cleaning up
expired objects appropriately.
I am very much aware of caching and clustering concepts. Now what I am not very sure about is that, how these cached deployed on the different managed servers will be kept in synch so that users don�t get the stale data??
What I have thought so far is that, I will design this clustered cache as a typical single JVM cache(normal cache which just runs fine on single JVM), and i will have to design another component probably using Java Messaging Services to keep these different cache in to the synch. This component will run asynchronously and shall send a message to a JMS Queue and all the clustered cache will listen to that particular JMS queue. As and when any message arrives at the queue, all the cache shall update their status, this way client shall never get an stale data.
Apart from this I want to go after this problem in a typical OOD way using typical design principles like Open/Close principle (extendibility remain high), Dependency Inversion principle (so that coupling between the various classes/component can be kept to a minimum as far as possible). Apart from this, I also want to use various GoF design
patterns too. All in all, it has to be a very flexible design which can be maintained over time without much hassles.
Can anybody please comment on my JMS thingy approach? Does that really sounds like a mature design or is these any better way of doing the same.
Thanks for showing patience
Jameel
[ August 27, 2006: Message edited by: Jammy Khan ]