Redis and memcached comparison
The two years of Redis fire, Redis is often used as a memcached challenger to be mentioned on the desktop. The comparison between Redis and memcached is ubiquitous. However, does Redis really go beyond memcached in terms of functionality, performance, and memory efficiency?
There is no need to focus too much on performance, as both are already high enough to perform. Because Redis uses only single cores, and memcached can use multicore, the two are compared on average, and Redis has a higher performance than memcached when storing small data on each core. In more than 100k of data, memcached performance is higher than Redis. Although Redis has also recently been optimized for the performance of storing big data, it is slightly less than memcached. Having said so much, the conclusion is that no matter which one you use, the number of requests per second will not be a bottleneck.
In terms of memory efficiency, memcached memory utilization is higher if simple key-value storage is used. If Redis uses a hash structure to do 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, it is recommended that you choose Redis. Because neither of these features is memcached. Choosing Redis is also wise, even if you just want the cached data to be not lost after upgrading or rebooting the system.
And, of course, you have to talk about your specific application needs in the end. Redis has more data structures and supports richer data operations than memcached. Usually in memcached, you need to get the data to the client to make similar changes and set it back. This greatly increases the number of network IO and the volume of data. In Redis, these complex operations are often as efficient as the general get/set. So, if you need caching to support more complex structures and operations, Redis is a good choice.
Redis and memcached comparison