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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With