Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(8)
Memcached 有多个Java 客户端。
Memcached has several Java Clients.
我的选择是 Apache 的 Java 缓存系统,它支持 TCP 横向缓存,我认为这是您需要的功能。
My option is Java Caching System from Apache, it has support of TCP Lateral Cache which in my opinion is the feature you need.
http://ehcache.org/ 是非常好的轻量级缓存。 它可以在多个 JVM 之间共享。
在内部它可以使用 JGroups。
http://ehcache.org/ is very good and light cache. It can be shared between multiple JVMs.
Internally it can use JGroups.
这个怎么样?
有一个本地 ConcurrentHashMap 作为本地缓存。
创建 Hazelcast 分布式地图/缓存。
开始监听分布式映射事件并更新本地 ConcurrentHashMap。
现在每个成员上的本地缓存将是相同的。 自动同步。
How about this?
Have a local ConcurrentHashMap as your local cache.
Create a Hazelcast distributed map/cache.
Start listening for the distributed map events and update your local ConcurrentHashMap.
Now local caches on each member will be the same. Auto-synched.
您是否考虑过 Infinispan - http://www.jboss.org/infinispan/ ? 该 API 非常简单并且基于标准 (JSR-107)。 使用方法也很简单
--Hardy
Have you considered Infinispan - http://www.jboss.org/infinispan/ ? The API is very simple and based on a standard (JSR-107). The usage is also very simple
--Hardy
经过一番搜索,我发现了 JGroup 的 ReplicatedHashMap。 它尚未经过彻底测试,但似乎是一个很好的开始。 它满足了我的所有要求,而又没有给我提供太多我不需要的功能。 它也非常灵活。 不过,我仍在寻找“完美”的答案:)
感谢您的回答。
After some more searching, I found JGroup's ReplicatedHashMap. It has not been thoroughly tested but it seems like an excellent start. It fills all my requirements without giving me too much features I don't need. It's also quite flexible. I'm still searching for the "perfect" answer though :)
Thanks for your answers.
你考虑过兵马俑吗? 可能有点过头了: http://www.terracotta.org/web/display/ orgsite/Data+Caching
不久前有一个关于缓存领域的 JSR,执行以下任一操作即可满足要求: http://java-source.net/open-source/cache-solutions/jcache ?
几年前我个人使用过FKache,效果很好,但我没有在分布式模式下使用它。
它是具有本地数据副本的分布式缓存,这很重要吗? 如果您需要共享内存,还有 JavaSpaces 的东西......
Have you considered Terracotta? Might be overkill: http://www.terracotta.org/web/display/orgsite/Data+Caching
There was a JSR in the area of caching a while ago, do any of the following fit the bill: http://java-source.net/open-source/cache-solutions/jcache ?
I personally used FKache a few years ago and it worked well, but I didn't use it in distributed mode.
Is it important that it's a distributed cache with local copies of data? There's also the JavaSpaces stuff if it's shared memory you need...
我在这方面使用过一些技术,我强烈推荐 JBoss Cache 作为最佳选择为了你想做的事。 它使用 JGroups 作为其传输,但提供了更高级别的事务抽象。 它开箱即用,为您提供分布式树节点结构。
编辑:哦,JBossCache是独立于JBoss应用服务器的,你可以在任何环境中使用它。 如果说有什么不同的话,那就是它在 JBossAS 之外比在 JBossAS 内部运行得更好。
I've used a few technologies in this area, I can highly recommend JBoss Cache as the best choice for what you're trying to do. It uses JGroups as its transport, but provides a higher-level transactional abstraction. Out-of-the-box it gives you a distributed tree-node structure.
edit: Oh, and JBossCache is independent of JBoss Application Server, you can use it in any environment. If anything, it works better outside of JBossAS than it does inside it.