对于Memcache和Java hashMap比较

本文探讨了Memcache和Java HashMap的相似之处和不同点。两者都是基于key-value存储,通过hash实现快速访问,并且都在内存中存储数据。Java内存的优势在于更快的速度和无需序列化,而Memcache则能跨应用服务器共享缓存,支持时间基无效化。此外,文章详细介绍了Memcache的访问方式、LRU内存释放算法以及其支持的数据格式。
摘要由CSDN通过智能技术生成

因队友陷落,还是自问自答吧…

二者相同点

二者都是key-value

且都是通过hash来存储

都是内存存储

二者不同

Advantages of Java memory over memcache:

  • Java memory is faster (no network).
  • Java memory won’t require serialization, you have Java objects available to you.

Advantages of memcache over Java memory

  • It can be accessed by more than one application server, so your cache will be shared among all your app servers.
  • It can be accessed by a variety of different servers, so long as they all agree on the key scheme and the serialization.
  • It will discard expired cache values, so you get time-based invalidation.

    a benchmark between a concurrent hash map, memcached, and My

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值