Redis and Memcache comparison

Source: Internet
Author: User
Tags comparison data structures redis


Reference link difference IO Model-memcache: Multi-threaded IO multiplexing (event-driven), Redis: single-threaded IO multiplexing (event-driven, single-threaded models can actually seriously affect overall throughput, and the entire IO schedule is blocked during CPU calculation) Memory allocation-Memcache: Using a pre-allocated pool of memory (Slab,chunk), Redis: Storing data in a way that uses on-the-spot memory, there is a certain amount of memory fragmentation. Data consistency-memcache: Using CAS to ensure data consistency, Redis: Using Transactional Operations functionality-Memcache: Basic support for simple key-value storage, enumeration not supported, persistence and replication capabilities, Redis: except Key/value, It also supports a number of data structures such as list,set,sorted Set,hash, which provides the keys for enumeration operations, but cannot be used online, while providing features such as persistence and replication distributed lock-memcache: Atomic operation Add () can set the expiration time, Redis: Requires set () and then expire (), once the outage is interrupted, it will lead to deadlock using the scenario Redis best practices are all data in-memory. Redis more scenes are used as substitutes for memcache. Redis is more appropriate when it is necessary to support more data types than Key/value. Redis is more appropriate when the stored data cannot be rejected.

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.