Caching mechanism cluster environment

三世轮回 提交于 2019-12-13 09:47:02

问题


If we use a static hash map for caching process in a normal class (Not a singelton class) will it work in cluster environment?


回答1:


A static field's value is stored in the memory of the JVM, and each JVM will thus have its own static map. This can be OK, unless you want a unique cache for all the members of the cluster.




回答2:


Seems like you're writing the requirements for a framework like Terracotta : http://terracotta.org/documentation/product-documentation-1page

You're talking about JVM memory sharing



来源:https://stackoverflow.com/questions/5909799/caching-mechanism-cluster-environment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!