Codementor Events

Redis vs Memcached

Published Aug 28, 2017
Redis vs Memcached

So, I was looking for a crystal clear comparison between these two wonderful cache systems. But I couldn't. I decided to do some research and create a list of top differences between two in a very concise and clear manner so that it helps anyone making a call between using either one for their current application.

  1. Memcached is in-memory key value store whereas Redis is in-memory data structures store.

  2. Memcached supports only string data type which is ideal for storing read-only data. Redis supports almost all types of data.

  3. Redis can also be used as a messaging system such as pubsub. Memcached cannot be used as a pubsub system.

  4. Memcached is more memory efficient than Redis. Redis is more memory efficient only after you use hashes.

  5. Memcached is volatile store and Redis is non-volatile. Means that data might be lost in Memcached after a reboot of the server/machine. On the other hand, Redis can handle persistent data, and by default Redis syncs data to the disk at least every 2 seconds.

  6. Memcached does not support replication, whereas Redis supports master-slave replication.

  7. Memcached stores variables in memory and retrieves data directly from server memory. Redis is like a database that resides in memory.

  8. Memcached is very good at handling high traffic websites. It can read lot of information at a time and have a great response time. Redis can not handle heavy traffic on read/write.

  9. Memcached maximum key length is 250 bytes whereas Redis has a maximum of 2gigs.

You can check out my Medium blog for more such articles.

Cheers!

Discover and read more posts from Rajendra Uppal
get started