当前位置:网站首页>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 !!!!
边栏推荐
- Network layer 7 protocol
- [au cours de l'entrevue] - Comment expliquer le mécanisme de transmission fiable de TCP
- fianl、finally、finalize三者的区别
- 2022泰迪杯数据挖掘挑战赛C题思路及赛后总结
- 1.C语言矩阵加减法
- JS interview questions (I)
- String ABC = new string ("ABC"), how many objects are created
- Differences among fianl, finally, and finalize
- 受检异常和非受检异常的区别和理解
- 一段用蜂鸣器编的音乐(成都)
猜你喜欢
4. Binary search
9.指针(上)
C language Getting Started Guide
西安电子科技大学22学年上学期《信号与系统》试题及答案
Write a program to simulate the traffic lights in real life.
[au cours de l'entrevue] - Comment expliquer le mécanisme de transmission fiable de TCP
西安电子科技大学22学年上学期《基础实验》试题及答案
8.C语言——位操作符与位移操作符
3. Number guessing game
一段用蜂鸣器编的音乐(成都)
随机推荐
(ultra detailed onenet TCP protocol access) arduino+esp8266-01s access to the Internet of things platform, upload real-time data collection /tcp transparent transmission (and how to obtain and write L
2.C语言初阶练习题(2)
编写程序,模拟现实生活中的交通信号灯。
【九阳神功】2018复旦大学应用统计真题+解析
Aurora system model of learning database
【手撕代码】单例模式及生产者/消费者模式
[面试时]——我如何讲清楚TCP实现可靠传输的机制
【九阳神功】2022复旦大学应用统计真题+解析
5.函数递归练习
1. C language matrix addition and subtraction method
[中国近代史] 第九章测验
1.C语言矩阵加减法
[中国近代史] 第五章测验
Comparison between FileInputStream and bufferedinputstream
5.MSDN的下载和使用
IPv6 experiment
一段用蜂鸣器编的音乐(成都)
vector
用栈实现队列
View UI plus released version 1.3.1 to enhance the experience of typescript