Redis vs Memcached
Published in
1 min readAug 24, 2017
- Memcached is in-memory key value store whereas Redis is in-memory data structures store.
- Memcached supports only string data type which is ideal for storing read-only data. Redis supports almost all types of data.
- Redis can also be used as a messaging system such as pubsub. Memcached cannot be used as a pubsub system.
- Memcached is more memory efficient than Redis. Redis is more memory efficient only after you use hashes.
- 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.
- Memcached does not support replication, whereas Redis supports master-slave replication.
- Memcached stores variables in memory and retrieves data directly from server memory. Redis is like a database that resides in memory.
- 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.
- Memcached maximum key length is 250 bytes whereas Redis has a maximum of 2gigs.
Cheers!