In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what is the persistence mechanism of Redis and what are its advantages and disadvantages?" the content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the persistence mechanism of Redis? what are its advantages and disadvantages?"
Redis provides two persistence mechanisms: RDB and AOF:
1. RDBRedis DataBase) persistence mode: semi-persistent mode using dataset snapshot) record all key-value pairs of the redis database and write the data to a temporary file at a certain point in time.
After the persistence is over, the last persisted file is replaced with this temporary file to achieve data recovery.
Advantages:
1. There is only one file dump.rdb, which is convenient for persistence.
2. Good disaster tolerance, a file can be saved to a secure disk.
3, performance maximization, fork child process to complete the write operation, let the main process continue to process commands, so it is IO maximization. Using a single child process for persistence, the main process does not perform any IO operations, which ensures the high performance of redis)
4. The startup efficiency is higher than that of AOF when the dataset is large.
Disadvantages:
1. Data security is low. RDB is persisted at intervals. If redis fails during persistence, data loss will occur. So this method is more suitable when the data requirements are not stringent)
2. AOFAppend-only file) persistence method: means that all command line records are completely persisted in the format of redis command request protocol) saved as aof files.
Advantages:
1. Data security. Aof persistence can be configured with appendfsync attribute. With always, every command operation is recorded in the aof file.
2. Write files through append mode, even if the server is down midway, you can solve the problem of data consistency through redis-check-aof tools.
3. Rewrite mode of AOF mechanism. Before the AOF file is rewrite (commands will be merged and rewritten when the file is too large), you can delete some of the commands (such as misoperated flushall).
Disadvantages:
1. AOF files are larger than RDB files, and the recovery speed is slow.
2. When the dataset is large, the startup efficiency is lower than that of rdb
Thank you for your reading, the above is "what is the persistence mechanism of Redis, what are its advantages and disadvantages". After the study of this article, I believe you have a deeper understanding of what the persistence mechanism of Redis is and what are its advantages and disadvantages. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.