We are developing an application in J2EE using Spring, Hibernate, REST. We want to store some data in cache. And, our application will work in clustered envrionment. Is it possible to have common cache in sync on all clusters? How to achieve this?
1. Is this for session management or Config Management
2. Can all nodes can write to cache or only master node can write and should be replicate to other nodes.
First you have to define what you want to cache. Caching static content can be done by using a front-end caching proxy server. Caching clustered session data is different from caching persistent storage data. Depending on architecture, each server might need a cache and/or you might want a cache for the cluster as a whole (especially if you're doing ReST).
Once you've determined where the bottlenecks are (preferably by measuring!) you will find that there are all sorts of ready-made caching solutions that you can plug into your system and tune. You just have to figure which ones you need.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.