Briefly describe the difference between Redis and MySQL, and briefly describe redismysql

Source: Internet
Author: User

Briefly describe the difference between Redis and MySQL, and briefly describe redismysql

We know that mysql is a persistent storage and stored in a disk. Some IO is involved in retrieval. To solve this bottleneck, a cache occurs, for example, the most commonly used memcached (mc ). First, the user accesses mc. If it does not hit mysql, the user accesses mysql, and then copies the data to a part of mc like the memory and hard disk.

Redis and mc are both cached and run in the memory, which greatly improves the access speed for web access with high data volumes. However, mc only provides a simple data structure, such as string storage. redis provides a large number of data structures, such as string, list, set, hashset, and sorted set, this makes it much easier for users. After all, it encapsulates a practical layer of functions and achieves the same effect at the same time. Of course, it is easy to discard mc with redis.

The relationship between memory and hard disk. The main data stored on the hard disk is used for persistent storage, while the memory is the part of data currently running. The CPU accesses the memory instead of the disk, which greatly improves the running speed, of course, this is a program-based principle of local access.

Reasoning to redis + mysql, It is a ing of memory + disk relationships. mysql is put on disk and redis is put in memory. In this way, the web application only accesses redis at a time. If no data is found, to access Mysql.

However, the usage of redis + mysql and memory + disk is preferably different.

The former is a memory database, and the data is stored in the memory, of course, the speed is fast.

The latter is a relational database with powerful functions and slow data access.

Such as memcache, mongoDB, and Redis all belong to the No SQL series.

It is not a type of thing, and the application scenario is not the same. It depends on your needs.

Summary

The above is all about the differences between Redis and MySQL. If you are interested, refer: SQL and MySQL statement execution sequence analysis, several important MySQL variables, and differences between FIND_IN_SET () and IN Mysql. If you have any shortcomings, please leave a message to confirm. Hope to help you.

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.