How to create a simple distributed Map for Java application?

帅比萌擦擦* 提交于 2019-12-10 10:16:35

问题


I am looking for a Map to share information between two instances of a Java web application running on separate machines. Reads and writes to this map need to be very fast and don't have to be transactional i.e. its ok if one instance has stale data for a while.

Any recommendations?

I need to keep track of the last time a user did something in the application, so its not terribly bad if this information is out of date. Speed and ease of use are important. I don't want writes to the Map to impact response times.


回答1:


I would try Hazelcast, JGroups or Ehcache. All support a distributed map.

EDIT: Another option is to use RMI top a service running in one or the other JVM. This avoids the need for an additional library.




回答2:


Additionally, there is Memcached which is very robust and proven over the time.



来源:https://stackoverflow.com/questions/7304291/how-to-create-a-simple-distributed-map-for-java-application

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