Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can google cache work in a clustered environment

I am caching data in a singleton ejb using google cache. And the cached resources are used by multiple ejbs. But now am not sure if the same application will work if deployed in a multinoded clustered environment where multiple JVMs can be present.

Please advise!

like image 841
user1455719 Avatar asked Sep 14 '25 05:09

user1455719


1 Answers

No, Guava Cache is not suitable for your use case, because it stores data in memory. See this wiki page:

Generally, the Guava caching utilities are applicable whenever:

  • You are willing to spend some memory to improve speed.
  • You expect that keys will sometimes get queried more than once.
  • Your cache will not need to store more data than what would fit in RAM. (Guava caches are local to a single run of your application. They do not store data in files, or on outside servers. If this does not fit your needs, consider a tool like Memcached.)

I can recommend you using Ehacache, it's very powerful and configurable.

like image 145
Xaerxess Avatar answered Sep 17 '25 20:09

Xaerxess