Current location - Loan Platform Complete Network - Big data management - Memcached really obsolete?Redis vs Memcached
Memcached really obsolete?Redis vs Memcached
These two years Redis fire can be, Redis is often as a challenger to Memcached is brought to the table. Comparisons between Redis and Memcached abound. However, does Redis really outperform Memcached in terms of features, performance, and memory efficiency? The following is from an answer given by the author of Redis on stackoverflow, corresponding to the question "Is memcached a dinosaur in comparison to Redis? You should not care too much about performances. Redis is faster per core with small values, but memcached is able to use multiple cores with a single Redis is faster per core with small values, but memcached is able to use multiple cores with a single executable and TCP port without help from the client. Also memcached is faster with big values in the order of 100k. Redis recently improved a lot about big values (unstable branch) but still memcached is faster in this use case. The point here is: nor one or the other will likely going to be your bottleneck for The point here is: nor one or the other will likely going to be your bottleneck for the query-per-second they can deliver. There's no need to be overly concerned about performance, as both are high enough. Since Redis only uses a single core, and Memcached can use multiple cores, on average Redis outperforms Memcached per core in comparison when storing small data. And in more than 100k of data, Memcached performance is higher than Redis, although Redis has also recently optimized the performance of storing large data, but compared to Memcached, it is still slightly inferior. Having said that, the conclusion is that the number of requests processed per second will not be the bottleneck, no matter which one you use. (You should care about memory usage. For simple key-value pairs memcached is more memory efficient. If you use Redis hashes, Redis is more memory efficient. Depends on the use case. For simple key-value pairs memcached is more memory efficient. If you use Redis hashes, Redis is more memory efficient. You should care about persistence and replication, two features only available in Redis. Even if your goal is to build a cache it helps that after an upgrade or a reboot your data are still there. If you have requirements about data persistence and data synchronization, then it is recommended that you choose Redis, because these two features are not available in Memcached. You should care about the kind of operations you need. In Redis there are a lot of complex operations, even In Redis there are a lot of complex operations, even considering the caching use case, you often can do a lot more in a single operation, without requiring data to be processed client side (a lot of I/O is This operations are often as fast as plain) This operations are often as fast as plain GET and SET. So if you don't need just GEt/SET but more complex things Redis can help a lot (think at Redis can help a lot (think at timeline caching). Of course, in the end, it comes down to your specific application needs; Redis has more data structures and supports richer data manipulation than Memcached, where you'd normally need to take the data to the client and make similar changes and then set it back. This greatly increases the number of network IO and data volume. In Redis, these complex operations are usually as efficient as a normal GET/SET. So, if you need the cache to be able to support more complex structures and operations, then Redis would be a good choice. (Others' responses are equally worth reading)