java 是否可以在没有 Terracotta Enterprise Suite 的情况下使用 Ehcache 实现分布式缓存?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9992899/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 23:10:23  来源:igfitidea点击:

Is it possible to implement distributed caching using of Ehcache without Terracotta Enterprise Suite?

javaehcachedistributed-caching

提问by Gadget

I try to find how to implement distributed caching for applications.

我试图找到如何为应用程序实现分布式缓存。

Ehcache already used for caching in my project, that's why I search how to solve this issue using it. But, unfortunately, it seems, that Terracotta Enterprise Suite is needed for this and it is commercial. Isn't it? Is there another solution how to use Ehcache for distributed caching (RMI or anything else)?

Ehcache 已经在我的项目中用于缓存,这就是为什么我搜索如何使用它来解决这个问题。但是,不幸的是,这似乎需要 Terracotta Enterprise Suite,而且它是商业的。不是吗?是否有另一种解决方案如何使用 Ehcache 进行分布式缓存(RMI 或其他任何东西)?

回答by Alex Snaps

You don't need terracotta enterprise suite to cluster you Ehcache instances. So you can use clustering with Ehcache & Terracotta today, with pure OSS :

您不需要 terracotta 企业套件来集群您的 Ehcache 实例。所以你今天可以使用 Ehcache & Terracotta 集群,使用纯 OSS :

http://www.ehcache.org/documentation/configuration/distributed-cache-configuration

http://www.ehcache.org/documentation/configuration/distributed-cache-configuration

Edit: This link has expired. Below is the new link related to clustered cache http://www.ehcache.org/documentation/3.4/clustered-cache.html

编辑:此链接已过期。以下是与集群缓存相关的新链接 http://www.ehcache.org/documentation/3.4/clustered-cache.html

Now if you need replication, you can use other mechanisms like RMI indeed :

现在,如果您需要复制,您确实可以使用其他机制,例如 RMI:

http://www.ehcache.org/documentation/replication/index

http://www.ehcache.org/documentation/replication/index

Though, only the Terracotta clustering would bring you HA and features like consistency guarantees and the like...

但是,只有 Terracotta 集群才能为您带来 HA 和一致性保证等功能......

回答by Fuad Malikov

You may want to try Hazelcastas well. It is open source, distributed cache and is super easy to use.

您可能也想尝试Hazelcast。它是开源的,分布式缓存,超级好用。

PS: I work for Hazelcast

PS:我为 Hazelcast 工作

回答by Dhiraj

there are different ways to implement distributed cache using ehcache mechanism. One can be using RMI or Jgroups.

使用ehcache机制实现分布式缓存有多种方式。一种可以使用 RMI 或 Jgroups。

In one of the project i came through same situation and after some research i figured out Using Redis server for cache management is a easy and effective solution.

在其中一个项目中,我遇到了同样的情况,经过一些研究,我发现使用 Redis 服务器进行缓存管理是一种简单有效的解决方案。

I suggesting this as a answer because if you try using ehcache it will take time and increase complexity and you can have multiple cache manager in your workspace.

我建议将此作为答案,因为如果您尝试使用 ehcache,它将花费时间并增加复杂性,并且您的工作区中可以有多个缓存管理器。