
Memcache internals (2011) - rajathagasthya
https://www.adayinthelifeof.nl/2011/02/06/memcache-internals/
======
Analemma_
Is memcache still in heavy use? It seems like everyone I see has replaced it
with Redis, but I don't know if this is a real tendency or the HN
bubble/magpie developer effect.

~~~
haimez
If you need an in memory cache, you use memcached. If you need data structures
and have trivial data sets (this is an enviable position) you use redis.

If you don't know why you need one or the other, use redis until you can't
anymore. Plenty of people still use memcache, although lots of the current
users are forking their implementation to get specific behaviors from the
internals.

~~~
chetanahuja
_" trivial data sets... you use redis"_

Can you elaborate on what you mean by "trivial data sets" and why is redis
only suitable for those?

~~~
ddorian43
Just check the docs: strings, integers, lists, hashes, sets, sorted sets, geo
etc

~~~
chetanahuja
So you mean trivial data _types_? Well how's memcached (the other alternative
in this discussion) gets you less trivial data types? Quite the contrary in
fact.

~~~
ddorian43
That's welcoming downvotes. I don't remember memcache giving you any
list/set/hash. Go check the docs.

------
antirez
I think the threading model is one of the most interesting part in memcached.
Unfortunately is not covered here but can be read from the sources quite
easily.

~~~
mmjaa
Care to give a summary?

~~~
gbrown_
The source repo contains a summary.

[https://github.com/memcached/memcached/blob/master/doc/threa...](https://github.com/memcached/memcached/blob/master/doc/threads.txt)

------
DrScump
(February 2011)

~~~
dang
Thanks, added.

