Is memcached outdated? [Post]

Source: Internet
Author: User

in the past two years, redis is very popular, redis is often treated as memcached was mentioned on the desktop. Comparison between redis and memcached is everywhere. However, does redis surpass memcached in terms of functionality, performance, and memory usage efficiency?

the following is an answer from the redis author on stackoverflow, is memcached A dinghuur in comparison to redis? (compared with redis, is memcached really outdated ?)

  • You shoshould 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 executable and TCP port without help from the client. also memcached is faster with big values in the order of 100 K. 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 query-per-second they can deliver.
  • there is no need to worry too much about performance, because the performance of both is high enough. Because redis only uses a single core, while memcached can use multiple cores, redis has higher performance than memcached in storing small data on average. Memcached has higher performance than redis in data of more than kb. Although redis has recently optimized its performance in storing big data, it is inferior to memcached. The conclusion is that no matter which one you use, the number of requests processed per second will not become a bottleneck. (For example, the bottleneck may be on the NIC)
  • You shoshould 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 memory usage efficiency and simple key-value storage, memcached memory usage is higher. If redis uses the hash structure for key-value storage, due to its combined compression, the memory usage is higher than that of memcached. Of course, this is related to your application scenarios and data features.
  • You shoshould 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 on data persistence and data synchronization, we recommend that you choose redis because memcached does not have these two features. Even if you just want to upgrade or restart the system and the cache data will not be lost, it is wise to choose redis.
  • You shocould care about the kind of operations you need. in redis there are a lot of complex operations, even just 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 sometimes needed ). 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 timeline caching ).
  • Of course, you have to talk about your specific application requirements. Compared with memcached, redis has more data structures and supports richer data operations. Generally, in memcached, you need to get the data to the client for similar modifications and then set it back. This greatly increases the number of network I/O operations and data volumes. In redis, these complex operations are generally as efficient as general get/set operations. Therefore, if you need the cache to support more complex structures and operations, redis will be a good choice.

Source:Is memcached a dinosaur in comparison to redis?(Other People's answers are also worth reading)

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.