Search code examples
memcachedreplicationdistributed-system

Does memcached use replica?


I know memcached uses consistent hashing to do sharding.
But, does memcached support replication and disk storage?

I assume it does not. Losing one of the caching server just means the cache miss for data in that shard. It's not a single point of failure.

However, I still want to confirm.


Solution

  • 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.