当前位置:网站首页>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 !!!!
边栏推荐
- 1.初识C语言(1)
- (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
- 仿牛客技术博客项目常见问题及解答(一)
- Thoroughly understand LRU algorithm - explain 146 questions in detail and eliminate LRU cache in redis
- A piece of music composed by buzzer (Chengdu)
- The difference between overloading and rewriting
- 2.初识C语言(2)
- [the Nine Yang Manual] 2018 Fudan University Applied Statistics real problem + analysis
- View UI plus released version 1.3.1 to enhance the experience of typescript
- Implement queue with stack
猜你喜欢
关于双亲委派机制和类加载的过程
3. C language uses algebraic cofactor to calculate determinant
9. Pointer (upper)
一段用蜂鸣器编的音乐(成都)
3.猜数字游戏
[during the interview] - how can I explain the mechanism of TCP to achieve reliable transmission
20220211-CTF-MISC-006-pure_ Color (use of stegsolve tool) -007 Aesop_ Secret (AES decryption)
2.C语言初阶练习题(2)
3.C语言用代数余子式计算行列式
MySQL事务及实现原理全面总结,再也不用担心面试
随机推荐
(超详细onenet TCP协议接入)arduino+esp8266-01s接入物联网平台,上传实时采集数据/TCP透传(以及lua脚本如何获取和编写)
强化学习系列(一):基本原理和概念
抽象类和接口的区别
Arduino+ds18b20 temperature sensor (buzzer alarm) +lcd1602 display (IIC drive)
Detailed explanation of redis' distributed lock principle
About the parental delegation mechanism and the process of class loading
String abc = new String(“abc“),到底创建了几个对象
[graduation season · advanced technology Er] goodbye, my student days
西安电子科技大学22学年上学期《信号与系统》试题及答案
1.C语言初阶练习题(1)
4.分支语句和循环语句
6.函数的递归
透彻理解LRU算法——详解力扣146题及Redis中LRU缓存淘汰
C语言实现扫雷游戏(完整版)
[中国近代史] 第九章测验
为什么要使用Redis
3.输入和输出函数(printf、scanf、getchar和putchar)
Wei Pai: the product is applauded, but why is the sales volume still frustrated
优先队列PriorityQueue (大根堆/小根堆/TopK问题)
Leetcode.3 无重复字符的最长子串——超过100%的解法