Difference between Redis and Memcached
Redis | Memcached |
---|---|
In Memory data structure Server | Distributed cache server with hight performance |
In Memory cache and perstistence storage | Only In Memory Storage |
Key is only strings, values Supports Rich set of data types to store | Supports String key and values only |
Supports to list all keys | Does not support to list all keys |
Master slave Replication is supported for failover | Does not support replication |
Supports Shards for better write access | Does not support scaling |
Supports pub and sub model | Does not support |
Supports LUA scripting to write stored procedure | Does not support |
When do you choose memcached over redis?
Both are for storing key and value pairs of data.
If you have a usecase of simple application that stores plain key and value pairs of strings and not required to store the data to disk.
if you have a data that has complexdata structure , supports for replication and sharding, You can choose redis.