What’s the difference between Redis and memcached? As Redis becomes more and more powerful, there are almost no companies using memcached today. Here are some of the differences Redis’s authors have made.

1. Redis supports server-side data operation

Redis has more data structures than memcached and supports rich data manipulation. Typically in memcached, you need to take the data to the client and make similar changes back in set. This greatly increases the number of network IO and the volume of data. In Redis, these complex operations are often just as efficient as normal GET/SET. So if you need a cache that can support more complex structures and operations, then Redis is a good choice.

2. Comparison of memory usage

With a simple key-value store, memcached will use more memory than memcached if Redis uses a hash structure for the key-value store, due to some combined compression.

3. Performance comparison

Because Redis only uses a single core and Memcached can use multiple cores, Redis performs better than Memcached for small data on average per core, and Memcached performs better for data over 100K. Although Redis is also optimized for storing large data, it is not nearly as good as memcached.

4. Cluster mode

Memcached does not have a native cluster mode and relies on clients to slice data into the cluster. Redis native supports claster mode.

These four points are basically all. In fact, I think 1 and 4 are the most important points, while others are not so important.

And memcached is definitely out of the picture now.