title: Centralized cache server. (Ehcache or Hazelcast)
body: <p>Currently we have 2 app severs, each has application level cache and has centralized database server. To keep both servers app cache in sync we have set up JMS broker in between. On cache clear on one server which sends message to JMS, since other is registered so it will get the message and clears the perticular entry based on message content. </p>
  
  <p>Since this messaging system adds latency in clearing the cache entry, for some amount of time there will be inconsistency between application level caches. </p>
  
  <p>So we thought of having centralized cache server to avoid all this extra work to done to keep all caches in sync.</p>
  
  <p>We are thinking of using <strong>Ehcache/Terracotta</strong> or <strong>Hazelcast</strong>,  these cache hold resultsets, locks info, and some system specific varaibles.</p>
  
  <p>Please suggest best cache solution for us.</p>