Traditional Culture Encyclopedia - Traditional customs - The difference between redis and mysql
The difference between redis and mysql
MySQL is a relational database; Redis is a non-relational database.
2. Different roles
Mysql is used to store data permanently to the hard disk, which is powerful but slow.
Redis is used to cache frequently used data, with fast reading speed.
3. Different storage types
Redis stores data in key-value format. The time complexity is O( 1), constant order, while the bottom implementation of MySQL engine is b+ tree, and the time complexity is O(logn), logarithmic order. Redis will be a little faster than MySQL.
Mysql data stores are stored in tables. When searching data, the table should be scanned globally or searched according to the index, which involves disk search. If the search is point by point, the disk search may be faster, but the sequential search will be slower. On the other hand, Redis doesn't have to bother. It is stored in memory itself, and will be fetched directly according to the location of data in memory.
- Previous article:How to see the aging fatigue of rubber joints?
- Next article:How to color mooncakes
- Related articles
- The world's top ten luxury wedding
- Online celebrity hotels take stock of Japan
- How many days does it take to check the car from Chengdu to Changchun?
- Characteristics of Traditional Buildings and Dwellings in Guangxi
- What are the effective ways to learn traditional culture?
- Xia's style of play
- Model essay on honest and civilized language
- What is the price of micro-needle hair transplant in Beijing? How much is the general fee?
- Honest and clean, governing the Soviet Union, strict but not demanding.
- Describe the great influence of military high technology on modern warfare.