第三方缓存软件 - 它们提供了什么? [英] third-party Caching software- what do they provide?

查看:151
本文介绍了第三方缓存软件 - 它们提供了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么要使用开箱即用的缓存产品,如ehcache或memcached?

Why would one want to use an out of the box caching product like ehcache or memcached ?

不是一个简单的hashmap吗?我理解这是一个天真的问题,但我希望看到一些关于什么时候一个简单的hashmap就足够了,第三方缓存解决方案有点过分的答案。

Wont a simple hashmap do ? I understand this is a naive question but I would like to see some answers about when a simple hashmap will suffice and a thirdparty caching solution is overkill.

推荐答案

Ehcache可以给你的一些东西,你必须用HashMap管理自己。

Some things Ehcache can give you, that you would have to manage yourself with a HashMap.

驱逐政策。如果您的数据永远不会增长,那么无需担心。但是如果你想防止内存泄漏最终破坏你的应用程序,那么你需要一个驱逐策略。使用ehcache,您可以配置缓存中元素的生存时间和空闲时间。

An eviction policy. If your data never grows, then no need to worry. But if you want to prevent a memory leak eventually breaking your app, then you need an eviction policy. With ehcache, you can configure the time to live, and time to idle of elements in your cache.

使用Terracotta进行集群缓存。如果您有多个tomcat用于故障转移/可伸缩性,那么您可以将Ehcache链接到Terracotta集群,以便所有实例在需要时可以看到相同的数据。

Clustered caching with Terracotta. If you have more than one tomcat for failover / scalability, then you can link Ehcache up to a Terracotta cluster, so that all instances can see the same data if needed.

透明磁盘溢出 - 在tomcat服务器或赤土陶器集群上。当数据不适合堆时。

Transparent disk overflow - be this on the tomcat server, or the terracotta cluster. When data doesn't fit into heap.

关闭堆存储。 BigMemory等新技术意味着您可以访问更大的内存缓存,而无需GC开销。

Off heap storage. New technologies such as BigMemory mean you have access to a much larger in-memory cache without GC overheads.

并发。 Ehcache可以使用ConcurrentDistributedMap在集群配置中提供最佳性能。

Concurrency. Ehcache can use a ConcurrentDistributedMap to give the optimal performance in a clustered configuration.

这只是冰山一角。

这篇关于第三方缓存软件 - 它们提供了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆