In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Using redis as the cache, does the data still need to be stored in the database?
My answer is:
Redis is just a cache, not a database such as mysql, so some databases in redis must be in mysql.
The user requests to request redis first, and if not, go to the database to read it.
Some data with a large number of requests are cached in redis (these cached data must also be available in mysql), so it is not necessary to cache all data in redis.
The reason why it is fast to get data from the cache is that the cached data exists in memory, unlike mysql's data on disk, that is, it does not have to go through the process of loading from disk to memory (which is very time-consuming and inefficient) to obtain data directly from memory.
When the redis cache crashes, then not a large number of requests go to access the database? Can the database hold up?
Accept to analyze, as hundreds of billions of requests to access at the same time, why can't the database bear it?
① has so much concurrency that the database can't handle it.
Let me give you an example.
100 million plsql clients visit Oracle at the same time for database query, write and other operations, the database must be unbearable.
From this point of view, redis is not very helpful.
② database is stored on low-speed devices, and every time you access the database, you have to go through io, that is, the process of transferring from disk to memory. This is the reason for using caching mechanisms such as redis.
These are the details of which data are put in redis and which are put in the database, please pay more attention to other related articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.