The comparison between Redis and memcached

Source: Internet
Author: User

Original: http://blog.nosqlfan.com/html/3729.html

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?

The following is an answer from the Redis author on StackOverflow, and the corresponding question is "is memcached a dinosaur in comparison to Redis?" (Is it really outdated compared to redis,memcached?). )

  • You should don't care too much about performances. Redis is faster per core with small values, but memcached was able to use multiple cores with a single executable and TCP p ORT without help from the client. Also memcached is faster with big values in the order of 100k. Redis recently improved a lot of big values (unstable branch) but still memcached are faster in this use case. The point here Is:nor one or the other would likely going to be your bottleneck for the query-per-second they can deliver.
  • There is no need to be overly concerned about performance, because both are already high enough in performance. Since Redis uses only single cores, and memcached can use multicore, on average, Redis has a higher performance than memcached for storing small data on a per-core scale. In more than 100k of data, memcached performance is higher than Redis, although Redis has recently been optimized for the performance of storing big data, but it is slightly inferior to 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. (such as bottlenecks may be in the network card)
  • Should care about memory usage. For simple key-value pairs memcached are more memory efficient. If You use Redis hashes, the Redis is more memory efficient. Depends on the use case.
  • If you want to say that memory usage efficiency, using simple key-value storage, memcached memory utilization is higher, and if Redis uses hash structure to do key-value storage, because of its combined compression, its memory utilization will be higher than memcached. Of course, this is related to your application scenario and data characteristics.
  • You should care about persistence and replication, and the other features only available in Redis. Even if your goal is to build a cache it helps a upgrade or a reboot your data is still there.
  • If you have requirements for data persistence and data synchronization, it is recommended that you choose Redis because neither of these features memcached. Choosing Redis is also wise, even if you just want the cached data to be not lost after upgrading or rebooting the system.
  • Your should care is about the kind of operations for you need. In Redis there is a lot of complex operations, even just considering the caching use case, you often can does a lot more in A single operation, without requiring data to being processed client side (a lot of I/O is sometimes needed). This operations is often as fast as plain GET and SET. So if you don ' t need just get/set and more complex things Redis can help a lot (think at timeline caching).
  • 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 for similar modifications 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.

Source: Is memcached a dinosaur in comparison to Redis? (other people's answers are also worth seeing)

Comparison of Redis and memcached (RPM)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.