skip to Main Content

I know memcache use consistency hashing to do shading.
But, do memcache do replication as disk storage?

I assume it will not. Since, losing one of the caching server just means the cache miss of that shard. It’s not a single point of failure.

However, I still want to confirm.

2

Answers


  1. No. Memcache does not support replication. Nor does it store any data on disk. Everything is stored on memory. This is the main reason memcache is so fast.

    Also in a way memcache is not distributed either. It is the client which takes into account multiple servers of memcache, not the memcache servers. The servers are unaware about the existence of the other servers.

    If you want replication you can take a look at repcache

    Also redis is a good alternative which offers many more functionalities.

    Login or Signup to reply.
  2. Redis and couchbase provide persistence – not sure if these are binary compatible with the memcache protocol.

    For replication I suggest having a look at mcrouter. I wrote my own script for pre-seeding memcache instances for high availability. See https://symcbean.blogspot.com/2023/01/usable-memcache.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search