gpt4 book ai didi

jakarta-ee - 谷歌缓存可以在集群环境中工作吗

转载 作者:行者123 更新时间:2023-12-03 16:45:28 25 4
gpt4 key购买 nike

我正在使用谷歌缓存在单例 ejb 中缓存数据。并且缓存的资源被多个 ejb 使用。但是现在不确定如果部署在可以存在多个 JVM 的多节点集群环境中,同一个应用程序是否可以工作。

请指教!

最佳答案

不,Guava Cache 不适合您的用例,因为它将数据存储在内存中。见 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.)


我可以推荐你使用 Ehacache ,它非常强大且可配置。

关于jakarta-ee - 谷歌缓存可以在集群环境中工作吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37675696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com