因队友陷落,还是自问自答吧…
二者相同点
二者都是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