当前位置:网站首页>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 !!!!
边栏推荐
- Pit avoidance Guide: Thirteen characteristics of garbage NFT project
- (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
- 【毕业季·进击的技术er】再见了,我的学生时代
- Mode 1 two-way serial communication is adopted between machine a and machine B, and the specific requirements are as follows: (1) the K1 key of machine a can control the ledi of machine B to turn on a
- 使用Spacedesk实现局域网内任意设备作为电脑拓展屏
- Aurora system model of learning database
- 最新坦克大战2022-全程开发笔记-1
- 3.C语言用代数余子式计算行列式
- 为什么要使用Redis
- 用栈实现队列
猜你喜欢
随机推荐
Questions and answers of "basic experiment" in the first semester of the 22nd academic year of Xi'an University of Electronic Science and technology
Pit avoidance Guide: Thirteen characteristics of garbage NFT project
7. Relationship between array, pointer and array
The overseas sales of Xiaomi mobile phones are nearly 140million, which may explain why Xiaomi ov doesn't need Hongmeng
仿牛客技术博客项目常见问题及解答(一)
C语言入门指南
FAQs and answers to the imitation Niuke technology blog project (I)
Leetcode.3 无重复字符的最长子串——超过100%的解法
Inaki Ading
FAQs and answers to the imitation Niuke technology blog project (III)
5月27日杂谈
String ABC = new string ("ABC"), how many objects are created
3.C语言用代数余子式计算行列式
5.MSDN的下载和使用
7.数组、指针和数组的关系
Write a program to simulate the traffic lights in real life.
[during the interview] - how can I explain the mechanism of TCP to achieve reliable transmission
[the Nine Yang Manual] 2016 Fudan University Applied Statistics real problem + analysis
[the Nine Yang Manual] 2019 Fudan University Applied Statistics real problem + analysis
2. Preliminary exercises of C language (2)