java 分布式缓存
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1486895/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Distributed Caching
提问by Claude Houle
I am looking for a java distributed caching solution. We would like features likes:
我正在寻找一个 Java 分布式缓存解决方案。我们希望功能喜欢:
- Distributed
- Auto-Discovery
- Redundancy
- Non-Centralized
- 分散式
- 自动发现
- 冗余
- 非集中式
We've analyzed a framework like TerraCotta which seems to be everything we would ever want from a caching framework... However, there seems to be a central caching node(s) that is required which become our single-point-of-failure.
我们已经分析了一个像 TerraCotta 这样的框架,它似乎是我们想要的缓存框架的一切……然而,似乎需要一个中央缓存节点,它成为我们的单点故障.
Any ideas other than rolling out our own solution?
除了推出我们自己的解决方案之外还有其他想法吗?
采纳答案by skaffman
I suggest either JBossCacheor EhCache(with a distributed cache listener). I've used both, I like both, and they both fit your requirements.
我建议使用JBossCache或EhCache(带有分布式缓存侦听器)。我都用过,我都喜欢,而且它们都符合您的要求。
回答by Fuad Malikov
回答by Hitesh
Try Infinispan . Infinispan cache can be used as distributed cache and also can be used as Replicated cache . There is no possibility of Single Point Failure . In distributed cache mode it can provide more space than Heap Size. Consider there is 4 node in cluster each with 1GB Heap Size and Infinispan use as Replicated cache then total size cluster has 1 Gb but if Infinispan used as Distributed cache and set 2 copy per data item then total size will be 2Gb . http://www.jboss.org/infinispan
试试 Infinispan 。Infinispan 缓存可以用作分布式缓存,也可以用作复制缓存。没有单点故障的可能性。在分布式缓存模式下,它可以提供比堆大小更多的空间。考虑集群中有 4 个节点,每个节点具有 1GB 堆大小和 Infinispan 用作复制缓存,则总大小集群有 1 Gb 但如果 Infinispan 用作分布式缓存并为每个数据项设置 2 个副本,则总大小将为 2Gb 。 http://www.jboss.org/infinispan
回答by Alex Miller
Terracotta recently acquired Ehcache and has released a tight integration of the Ehcache API with the Terracotta clustered storein a simple package and only requires a few extra lines of Ehcache configuration to go from single node to clustered, although you also have to run the Terracotta server process.
Terracotta 最近收购了 Ehcache,并在一个简单的包中发布了 Ehcache API 与 Terracotta 集群存储的紧密集成,只需要几行额外的 Ehcache 配置即可从单节点到集群,尽管您还必须运行 Terracotta 服务器过程。
Ehcache with the Terracotta ES edition is open source and free to use. Commercial licenses are available if you want support, more scaling, indemnification, patch support, etc.
带有 Terracotta ES 版本的 Ehcache 是开源的并且可以免费使用。如果您需要支持、更多扩展、赔偿、补丁支持等,则可以使用商业许可证。
Terracotta does use a central server array, not a single central server, so there is no single point of failure! You can set up as many hot backup servers as you want and these backup servers can be configured to take over when the active server goes down. With Terracotta FX (commercial product), you can also use multiple active servers.
Terracotta 确实使用了中央服务器阵列,而不是单个中央服务器,因此不存在单点故障!您可以根据需要设置任意数量的热备份服务器,这些备份服务器可以配置为在活动服务器出现故障时接管。使用 Terracotta FX(商业产品),您还可以使用多个活动服务器。
回答by andy boot
Have you looked at Coherence?
你看过 Coherence 吗?
We have found it very useful. It is not open source or cheap though.
我们发现它非常有用。虽然它不是开源的或便宜的。
http://www.oracle.com/technology/products/coherence/index.html
http://www.oracle.com/technology/products/coherence/index.html
回答by Basit Anwer
I'm late to the party but have you tried TayzGrid, an open source java distributed cache. Also known as in-memory data grid or key value store.
我迟到了,但你有没有试过 TayzGrid,一个开源的Java 分布式缓存。也称为内存数据网格或键值存储。
It answers all your basic needs
它可以满足您的所有基本需求
- Distributed
- Auto-Discovery
- Redundancy
- Non-Centralized
It also manages advanced failover scenarios like split brainand sudden restarts. All nodes are intelligent therefore completely distributed.
它还管理高级故障转移场景,如裂脑和突然重启。所有节点都是智能的,因此是完全分布式的。
You also can also make a choice of which topology you want to use (Partition or replicated). If you want to use more advanced topologies(Partition of replica) then you can maybe buy a license.
您还可以选择要使用的拓扑(分区或复制)。如果您想使用更高级的拓扑(副本分区),那么您可以购买许可证。
回答by Jammy
Normally single point of failure occurs when all the operation are done on a single node and if that node goes down, the whole operation can go down. the solution of this problem is to use topology like Replica or partition replica. if once node goes down, the whole operation will shift to an other node without any kind of data lose.
当所有操作都在单个节点上完成时,通常会发生单点故障,如果该节点出现故障,则整个操作可能会出现故障。这个问题的解决方案是使用拓扑,如副本或分区副本。如果一旦节点宕机,整个操作将转移到另一个节点,而不会丢失任何类型的数据。
as far as the features which you are looking can be found in a single product, NCache,as Umer has also mentioned.
至于您正在寻找的功能可以在单个产品NCache 中找到,正如 Umer 也提到的。
回答by Aaron Digulla
Terracottaalso offers a distributed cache.
Terracotta还提供分布式缓存。

