休眠EHCache与MemCache [英] Hibernate EHCache vs MemCache

查看:94
本文介绍了休眠EHCache与MemCache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Web应用程序中使用缓存,该缓存也可以扩展和分发.

I would like to use caching in my web application which will be scalable and distributed as well.

我在小型Web应用程序中分别使用过EHCache和MemCache.

I have used EHCache and MemCache both in small-small web application separately.

在Google上进行了搜索并获得了不同的评价,因此希望获得各自的帮助和强大功能,因此我可以决定哪种框架适合我的Web应用程序.

Have googled and got mixed review about both, hence would like to get some help and strong features of each, so i can decided which framework is suitable for my web application.

让我知道是否需要更多详细信息.

Let me know if need further details.

谢谢!!

推荐答案

EHCache非常容易与Hibernate应用程序(使用Hibernate作为后端ORM的Web应用程序)集成.您也可以将其作为单独的工件导入,并以编程方式进行处理,例如将数据添加到具有指定到期期限或最大对象数或大小的命名缓存中.

EHCache is very easy to integrate with Hibernate applications (web apps that use Hibernate as a backend ORM). You can also import it as a separate artifact and do stuff in a programmatic way, like add data to a named cache with a specified expire period or number of max objects, or size.

Memcached不太容易与休眠应用程序集成,但本质上提供了与EHCache几乎相同的API用于编程访问.

Memcached is not that easily integrated with hibernate applications but in essence provides almost the same API for programmatic access as the EHCache.

就性能而言,结果也将根据缓存的体系结构和使用情况而有所不同.

As far as performance goes, results will also vary depending on architecture and usage of the cache.

总而言之,在选择缓存时,如果您以标准方式使用,则只是选择要选择的缓存而已.我个人会选择EHCache,因为我对此有相当多的经验.

In conclusion, when choosing a cache, if you are using in a standard way, it is just a matter of preference which cache you are going to choose. I, personally, would choose EHCache as I have considerably more experience with it.

JBoss也有一个分布式缓存(在由机器集群共享的缓存中),其中同步是在内部处理的,并且该API与EHCache非常相似.它称为Infinispan,而且相对易于设置和使用.

There is a distributed cache by JBoss as well (as in cache shared by a cluster of machines) where sync is handled internally and the API is very similar to EHCache. It is called Infinispan and is also relatively easy to set up and use.

作为EHCache的强大功能,我将把无缝集成列为Hibernate的第二级缓存.另外,以编程方式配置缓存非常容易且具有Java风格.

As a strong feature of EHCache, I would list the seamless integration as a second-level cache for Hibernate. Also, configuring a cache in a programmatic way is very easy and Java-esque.

也许最好还是请您参考一下以比较性能.请记住,它是古老的,所以可能不是很新. http://gregluck.com/blog/archives/2007/05/comparing-memcached-and-ehcache-performance/

Maybe it is also a good idea to refer you to this for a comparison of performance. Keep in mind it's ancient, so maybe is not very up to date. http://gregluck.com/blog/archives/2007/05/comparing-memcached-and-ehcache-performance/

这篇关于休眠EHCache与MemCache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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