Memcached and Redis contrast and application scenarios

Source: Internet
Author: User
Tags memcached redis

About the use of memcached and Redis scene, according to the great God's discussion and I found the information on the Internet, summed up: The comparison: The Redis provides data persistence function, memcached no persistence; Redis's data structure is richer than memcached, and can accomplish things beyond the scene; memcached's single key is limited to 512MB of K and V in 1mb;redis, of course, these values can be modified in the source code; Memcached Data recycling is based on the LRU algorithm, Redis provides a variety of recycling strategies (including LRU), but the expiration logic of the Redis recovery policy is not dependent on the existence of a key to determine whether the expiration. However, it can be judged whether the expiration is based on the TTL return value, memcached using multiple threads, and Redis using a single-threaded, high-speed access based on Io multiplexing. So it can be understood that in extreme cases memcached throughput is greater than redis. Redis Hgetall's pit, you can check it out on the Internet. Conclusion: ordinary kv scene: Memcached, Redis all can. From the point of view of the single function module, recommend memcached, only do the cache one thing. In the case where the kv length is large, the data structure is complex (such as taking a piece of data of a value), need to be persisted, it is more suitable to use Redis: But when using Redis, the blocking of a single request causes a backlog of subsequent requests, needing attention to the code base memcached:
Https://github.com/memcached/memcached/blob/master Redis code Base:
Https://github.com/antirez/redis

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.