Why is it faster to access a cache database such as Redis?

Source: Internet
Author: User

first of all, we know that MySQL is persistent storage, stored in the disk, retrieval, will involve a certain IO, in order to solve the bottleneck, so there is a cache, such as the current use of the most memcached (referred to as MC).
First, the user accesses the MC, if not hit, to access MySQL, and then like memory and hard disk, the data copied to the MC part of the Redis and MC are cached, and all reside in memory running, which greatly improves the access speed of high data volume Web Access.
However, MC simply provides a simple data structure, such as string storage, and Redis provides a large number of data structures, such as String, list, set, HashSet, sorted set these, which makes the user convenient a lot of, after all, encapsulated a layer of practical functions, at the same time
Achieve the same effect, of course, using Redis and slowly discard MC. Memory and hard disk relationship, hard disk placement principal data for persistent storage, and memory is currently running part of the data, CPU access to memory rather than disk, which greatly increased the speed of operation,
This is, of course, based on the local access principle of the program. Reasoning to Redis+mysql, it is a mapping of memory + disk relationships, MySQL placed on disk, Redis placed in memory, so that the Web app accesses only Redis at a time, and if no data is found, it accesses MySQL.
However, the use of redis+mysql and memory + disks is best different.

Why is it faster to access a cache database such as 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.