Is Memcached really out of date?

Source: Internet
Author: User
Tags memcached memory usage redis

These two years Redis fire, and Redis are often referred to as memcached Challenger on the table. The comparison of Redis and memcached is everywhere. However, Redis really goes beyond memcached in functionality, performance, and memory usage efficiencies.

The following is from an answer from the Redis author on StackOverflow, and the question is "is memcached a dinosaur in comparison to Redis?" (compared to redis,memcached really obsolete. You should not care too much about performances. Redis is faster each core with small values, but memcached are able to use multiple cores with a single executable and TCP p ORT without help from the client. Also memcached is faster with the "the" Order of 100k. Redis recently improved a lot about big values (unstable branch) but still the is memcached in the use case. The point here is Is:nor one or the other would likely going to is your bottleneck for the query-per-second they can deliver. There is no need to be overly concerned with performance because both are already high enough. Since Redis only uses a single core, and memcached can use multi-core, in comparison, the average redis on each kernel is higher than the memcached performance in storing small data. In more than 100k of data, memcached performance is higher than Redis, although Redis recently in the storage of large data performance optimization, but compared to memcached, or slightly inferior. Having said so much, the conclusion is that no matter which one you use, the number of requests processed per second will not be a bottleneck. (for example, the bottleneck may be in the NIC) you should care about memory usage. For simple key-value pairs memcached are more memory efficient. If use Redis hashes, Redis are more memory efficIent. Depends on the use case. If you want to say memory usage efficiency, use 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 rate will be higher than memcached. Of course, this is related to your application scenarios and data features. You are should care about persistence and replication, two features only available in Redis. Even if your goal is to build a cache it helps this after a upgrade or a reboot your data are still. If you have a requirement for data persistence and data synchronization, it is recommended that you choose Redis because neither of these features memcached. Even if you just want the cached data to be lost after upgrading or restarting the system, it's also wise to choose Redis. You are should 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 does a lot more in A single operation, without requiring the data to be processed client side (a lot of I/O is sometimes needed). This is 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 (on the "at timeline caching). Of course, finally have to talk about your specific application needs. 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 back. This greatlyIncrease 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, then Redis would be a good choice.

Source: Is memcached a dinosaur into comparison to Redis? (other people's answer is also worth a look)

Memcached's detailed description: please click here
memcached Download Address: Please click here
Want to access open source via mobile client China: please click here


Memcached is a high-performance distributed memory object caching system for dynamic Web applications to reduce database load. It reduces the number of read databases by caching data and objects in memory, providing the speed of dynamic, database-driven Web sites.


For design options, for the top two caches, just consider two things: 1. Memcache using multithreading mechanism, redis using single-threaded; 2. Redis supports rich data structures, Memcache has only one


Sina Weibo uses more Redis
We also used the Redis in the new product and also used the memcache.
The biggest difference between Redis and Memcache is that the memcache data is kept in memory, and Redis is stored in binary files.
So we put some data that's always easy to change in the Redis, so it's faster to update than in the database, and there's some data that's not easy to change in the memcache.

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.