当前位置:网站首页>Principles, advantages and disadvantages of two persistence mechanisms RDB and AOF of redis
Principles, advantages and disadvantages of two persistence mechanisms RDB and AOF of redis
2022-07-06 13:40:00 【Wake up duck, did you program today?】
Here is Redis The advantages and disadvantages of the two persistence mechanisms are also very important :
Redis Based on Key-Value Structure of the memory database ,Redis for fear of Redis A problem of data loss caused by failure provides RDB and AOF Two persistence mechanisms
- RDB The persistence mechanism is implemented through snapshots , In other words, according to a trigger condition of the snapshot, the data snapshot in memory will be written to the disk and stored in the form of binary compressed files RDB There are many snapshot methods as follows :
- perform bgsave Command triggers an asynchronous snapshot , perform save Command triggers a synchronized snapshot , The difference between the two : Synchronizing snapshots can block the client's execution instructions
- according to redis.conf The configuration in the file , Automatic triggering bgsave
- The master-slave copy will trigger
- AOF Persistence is a near real-time approach , hold Redis Server Execute the transaction command for additional storage , That is, the customer is performing a data change operation ,Redis Such a command will be appended to aof In the buffer of , Then write the data in the buffer to the disk aof In the document , When finally Really persistent data to disk aof In the document , It is determined according to the disk brushing strategy , in addition AOF A way of appending this instruction will cause AOOF Too large file brings obvious IO Performance issues , therefore Redis For such a situation, it provides AOF Rewrite mechanism , When AOF When the file size reaches a certain value, the same instructions in the file will be compressed
RDB and AOF Advantages and disadvantages :
- RDB Is to trigger persistence at regular intervals , Therefore, the data security is low ,AOF It can achieve real-time persistence , Data security is high
- RDB Files are persisted by compression by default ,AOF Stored are execution instructions , therefore RDB Performance ratio during data recovery AOF It is better to
The advantages and disadvantages also depend on the current specific application scenarios !!!!
边栏推荐
- [modern Chinese history] Chapter 9 test
- [au cours de l'entrevue] - Comment expliquer le mécanisme de transmission fiable de TCP
- 1.初识C语言(1)
- String ABC = new string ("ABC"), how many objects are created
- Redis的两种持久化机制RDB和AOF的原理和优缺点
- 3.猜数字游戏
- 魏牌:产品叫好声一片,但为何销量还是受挫
- Atomic and nonatomic
- Leetcode. 3. Longest substring without repeated characters - more than 100% solution
- Custom RPC project - frequently asked questions and explanations (Registration Center)
猜你喜欢
这次,彻底搞清楚MySQL索引
MPLS experiment
FAQs and answers to the imitation Niuke technology blog project (II)
2022泰迪杯数据挖掘挑战赛C题思路及赛后总结
PriorityQueue (large root heap / small root heap /topk problem)
3.输入和输出函数(printf、scanf、getchar和putchar)
[au cours de l'entrevue] - Comment expliquer le mécanisme de transmission fiable de TCP
Change vs theme and set background picture
The overseas sales of Xiaomi mobile phones are nearly 140million, which may explain why Xiaomi ov doesn't need Hongmeng
8. C language - bit operator and displacement operator
随机推荐
(super detailed II) detailed visualization of onenet data, how to plot with intercepted data flow
一段用蜂鸣器编的音乐(成都)
【九阳神功】2019复旦大学应用统计真题+解析
8. C language - bit operator and displacement operator
5. Download and use of MSDN
Mortal immortal cultivation pointer-1
JS interview questions (I)
Questions and answers of "Fundamentals of RF circuits" in the first semester of the 22nd academic year of Xi'an University of Electronic Science and technology
string
C language Getting Started Guide
7. Relationship between array, pointer and array
2022泰迪杯数据挖掘挑战赛C题思路及赛后总结
[the Nine Yang Manual] 2021 Fudan University Applied Statistics real problem + analysis
强化学习系列(一):基本原理和概念
Questions and answers of "basic experiment" in the first semester of the 22nd academic year of Xi'an University of Electronic Science and technology
[during the interview] - how can I explain the mechanism of TCP to achieve reliable transmission
2.C语言矩阵乘法
Change vs theme and set background picture
A comprehensive summary of MySQL transactions and implementation principles, and no longer have to worry about interviews
这次,彻底搞清楚MySQL索引