• Post Reply Bookmark Topic Watch Topic
  • New Topic

Implemeting application level cache to cluster

 
mik laan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I need a application level cache to a clustered application. Cache can use database e.g. with entitybean. Web Application will get an interface to this cache via a Singleton class. Cache will handle ids that Web application will need to it's purposes. Ids are reusable so, that Web application gets a free id from cache via Singleton interface and Web application will also frees it when it does not need it anymore (it's read-write cache). After timeout ids should be marked as freed by some logic.
So, my question is:
If this kind of Singleton and entitybean approach is used in clustered environment, what is the righ please to insert this kind of id handling logic? Can entitybean (maybe BMP) contain this kind of logic or should it exist somewhere else?
I have understood that Singleton can not handle this logic because because there might be multiple instances of it in cluster (Singleton instance per JVM).
I have also read some whitepapers considering products like JCache and JCS, but before I staring to use them I would like to know if Singleton & entitybean approach is usable at all.
Any ideas?
Br
ML
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not useful unless you have some sort of synchronization mechanism outside of the EJB's. My Paper on the Distributed Cache Pattern describes this in detail.
Kyle
 
Rob Misek
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mik,
If you are looking for an application level cache to a clustered application take a look at Tangosol's Coherence product.
Coherence has the ability to cache data/objects in a distributed or replicated manner synchronously across the cluster. It implements a locking mechanism along with a javabean event model style notifications of inserts, update and removals.
Data/Objects are accesses and modified through a java.util.Map interface. Very easy to use and 100% reliable.
Later.
 
mik laan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kyle & Co!
Yes, this quite intetested subject ... and
quite difficult too ;=)
Br
Mik
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!