We know that MySQL is a persistent storage, stored in the disk, and retrieval will involve certain IO. In order to solve this bottleneck, cache appeared, such as the most commonly used memcached (mc for short). First, the user accesses mc. If there is no hit, he accesses mysql. Then, like memory and hard disk, the data is copied to part of mc. Both redis and MC are caches, and both run in memory, which greatly improves the access speed of high-data-volume web access. However, mc only provides simple data structures, such as string storage; redis provides a large number of data structures, such as string, list, set, hashset, sorted set, etc., which makes it much more convenient for users. After all, it encapsulates a layer of practical functions and achieves the same effect. Of course, use redis and gradually abandon mc. The relationship between memory and hard disk is that the hard disk stores the main data for persistent storage, while the memory is the data that is currently running. The CPU accesses the memory instead of the disk, which greatly improves the running speed. Of course, this is based on the principle of localized access of the program. Reasoning about redis+mysql, it is a mapping of memory+disk relationship. MySQL is placed on disk and redis is placed in memory. In this way, the web application only accesses redis each time, and only accesses Mysql if the data is not found. However, the usage of redis+mysql and memory+disk is better to be different. The former is an in-memory database, and the data is stored in memory, so of course it is fast. The latter is a relational database with powerful functions but slow data access. Like memcache, mongoDB, Redis, all belong to the No sql series. They are not of the same type and their application scenarios are also different. It depends on your needs. Summarize The above is all about the brief description of the differences between Redis and MySQL in this article. Interested friends can refer to: Analysis of the execution order of sql and MySQL statements, several important MySQL variables, and a brief analysis of the differences between FIND_IN_SET() and IN in Mysql. If there are any deficiencies, please leave a message to correct them. I hope this helps you all. You may also be interested in:
|
<<: Example of how to deploy Spring Boot using Docker
>>: Use dockercompose to build springboot-mysql-nginx application
For front-end developers, ensuring that the code ...
Color is one of the most important elements for a...
When making a new version of the configuration in...
Table of contents 1. General steps for SQL optimi...
I have recently been following the CSS Animation ...
Preface MySQL 8.0.13 began to support index skip ...
Table of contents 1. Introduction 2. Aggregation ...
1. Download the 64-bit zip file from the official...
MySQL 5.7.17, now seems to be the latest version,...
Preface Because computer numbers are floating poi...
Table of contents What is the Apollo Configuratio...
I downloaded and installed the latest version of ...
Linux and Unix are multi-user operating systems, ...
Achieve results Implementation Code html <div ...
Because Ubuntu 20.04 manages the network through ...