Is Memcached Really Obsolete?

In the past two years, Redis has been very popular, and Redis is often brought to the table as a challenger to Memcached.
Comparisons between Redis and Memcached abound. However, does Redis really surpass Memcached in functionality, performance, and memory usage efficiency?
There is no need to focus too much on performance, as both are high enough. Since Redis only uses a single core, and Memcached can use multiple cores,
comparing the two, on average, on each core, Redis has higher performance than Memcached when storing small data. In the data above 100k, the
performance of Memcached is higher than that of Redis. Although Redis has recently optimized the performance of storing big data, it is still slightly inferior to Memcached.
Having said all this, the conclusion is that no matter which one you use, the number of requests per second will not be the bottleneck. In terms of memory usage efficiency,
if a simple key-value store is used, the memory utilization of Memcached is higher. If Redis uses hash structure for key-value storage,
its memory utilization will be higher than Memcached due to its combined compression. Of course, this is related to your application scenario and data characteristics.
If you have requirements for data persistence and data synchronization, then it is recommended that you choose Redis. Because these two features Memcached does not have.
Even if you just want cache data not to be lost after an upgrade or reboot, choosing Redis is wise.
Of course, in the end you have to talk about your specific application needs. Compared with Memcached, Redis has more data structures
and supports richer data operations. Usually in Memcached, you need to get the data to the client to make similar changes and then set it back.
This greatly increases the number of network IOs and data volume. In Redis, these complex operations are usually as efficient as normal GET/SET.
So, if you need the cache to support more complex structures and operations, then Redis will be a good choice.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326996419&siteId=291194637