Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cache clustering  RSS feed

 
saurabh khattar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Our application is build on top of retail domain and has a section called eCatalogue where users can browse through range of Product available to retail.

Our application is maintaining in-memory cache to manage large number of products, to avoid everytime daatbase hit to get the product detail.

Presently the application is running in single App Server, so there is no problem related to it. Now client is migrating the environment in cluster mode.

As all the managed Servers will run in mutiple JVM, some criteria needs to be impelemnt for in-memory replication of Product cache in every JVM, so that the cache is in sync.

Please recommend some criteria, how we achieve this?
One of the resolution can be, using JMS. But in case of JMS, how will the listeners on every Managed Server will run?

Looking forward for the response.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google for "java distributed cache" and you'll find a number of commercial and open source products. There is a committee working on an API spec for future J2EE specs, chaired by the CEO of one of those commercial caches.

You can take a simplistic approach to building one. Any time you update a database value that is also cached publish a message to the other servers in the cluster to invalidate the key. Then next time somebody looks in the cache for that key they won't get anything and the server will have to reload the value for that key. The server that publishes the message will also receive it. It's probably ok for that server to invalidate the key too.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!