Caching mechanism cluster environment

2019-09-25 09:49发布

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

标签: java java-ee
2条回答
Anthone
2楼-- · 2019-09-25 10:13

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

查看更多
一夜七次
3楼-- · 2019-09-25 10:34

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.

查看更多
登录 后发表回答