开发者

How to create a simple distributed Map for Java application?

开发者 https://www.devze.com 2023-04-02 05:01 出处:网络
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 t开发者_运维知识库o be very fast and don\'t

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 t开发者_运维知识库o 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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消