In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
What are the advantages of using redis? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
When do you tend to choose redis?
1. Complex data structure
When value is a complex data structure such as hash, list, collection, ordered collection, etc., it is more appropriate to choose redis, because mc can not meet such requirements.
Typical scenarios: user messages, comments, order list, etc.
2. Persistence
Mc does not support persistence
But the use of redis persistence should be paid attention to.
Never use redis as a database:
1) regular snapshots of redis cannot guarantee that data will not be lost
2) the AOF of redis will reduce efficiency and cannot support too much data.
What are the advantages and disadvantages of caching scenarios and enabling persistence?
Advantages: restart downloader, quickly recover hot data in memory, share database pressure, and have no cache preheating process.
Disadvantages: after the redis is hung up, the data in the database is modified, which may lead to data inconsistency in redis.
Read-only scenarios, or some business scenarios that allow inconsistencies, can try to enable redis persistence
3. Natural high availability
Redis naturally supports cluster function, which can achieve master-slave replication, read-write separation.
Redis officially provides sentinel cluster management tools, which can realize master-slave service monitoring and automatic fault transfer.
Mc needs secondary development in order to achieve high availability.
It is important to note that in most business scenarios, does caching really need to be highly available?
1) in many cases, cache miss is allowed to save scenes.
2) the cache is suspended, and data can be read through DB in many cases.
4. The value stored is very large.
Value storage of mc. The maximum is 1m. If the value stored is very large, only redis can be used.
Thank you for reading! After reading the above, do you have a general understanding of the advantages of using redis? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.
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.