The difference between Redis and memcache

Source: Internet
Author: User
Tags cas

The difference between Redis and memcache

Data type:

Redis data type rich, support set Liset and other types
Memcache supports simple data types and requires clients to handle complex objects themselves

Durability:

Redis supports data-on-ground persistent storage
Memcache does not support data persistent storage

Distributed storage:

Redis supports Master-slave replication mode
Memcache can be distributed using consistent hash

Value differs in size:

Memcache is a memory cache, the key is less than 250 characters in length, and a single item store is less than 1M, not suitable for use by a virtual machine

Data consistency is different:

Redis uses a single-threaded model to ensure that the data is submitted sequentially.
Memcache need to use CAS to ensure data consistency. CAS (Check and Set) is a mechanism for ensuring concurrency consistency and belongs to the "optimistic lock" category; The principle is simple: take the version number, the operation, the comparison version number, if the same operation, inconsistent to abandon any operation

CPU Utilization:

The Redis single-threaded model can use only one CPU to open multiple Redis processes

The difference between Redis and memcache

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.