当前位置:网站首页>What are RDB and AOF
What are RDB and AOF
2022-07-06 20:49:00 【51CTO】
RDB:Redis DataBase, Writes a snapshot of a dataset in memory within a specified time interval ⼊ disk , The actual operation process is fork⼀ individual ⼦ process , First write the data set to ⼊ The temporary file , After writing successfully , Replace the previous ⽂ Pieces of , use ⼆ Binary compressed storage .
advantage :
- Whole Redis The database will contain only ⼀ individual ⽂ Pieces of dump.rdb, Easy persistence .
- Good disaster tolerance , Easy backup .
- Maximize performance ,fork Sub process to complete the write operation , Let the main process continue processing commands , So it is IO Maximize . Use a single child process for persistence , The main process will not enter ⾏ whatever IO operation , To ensure the redis A high performance
- Relative to the dataset ⼤ when , Than AOF It's more efficient to start .
shortcoming :
- Data security is low .RDB It's the interval ⼀ For a while ⾏ Persistence , If between persistence redis Hair ⽣ fault , Will send ⽣ Data loss . So this kind of ⽅ The formula is more suitable when the data requirements are not strict .
- because RDB It's through fork⼦ Process to assist in data persistence ⼯ Made , therefore , If the dataset is smaller ⼤ when , This may cause the entire server to stop ⽌ Service for hundreds of milliseconds , Even 1 Second .
AOF:Append Only File, Record every... Processed by the server in the form of a log ⼀ Write it 、 Delete operation , The query operation will not record , Record as text , Can open ⽂ See the detailed operation record
advantage :
- Data security ,Redis Provided in 3 Medium synchronization policy , Synchronization per second 、 Sync and out of sync per change . in fact , Synchronization per second is also done asynchronously , It's also very efficient , The difference is ⼀ Once the system goes down , So this ⼀ Data modified within seconds will be lost . And every modification is synchronized , We can think of it as synchronous persistence , That is, every time ⽣ All data changes will be immediately recorded on disk .
- adopt append Pattern writing ⽂ Pieces of , Even if the server goes down halfway, it will not destroy the existing content , Can pass redis check-aof Tools to solve data ⼀ A sexual question .
- AOF The mechanism rewrite Pattern . On a regular basis AOF⽂ Piece to rewrite , In order to achieve the purpose of compression
shortcoming :
- AOF File than RDB The file is big , And the recovery speed is slow .
- When the data set is large , Than rdb Low starting efficiency .
- Operational efficiency is not RDB high , AOF⽂ Piece ratio RDB High update frequency , priority of use AOF Restore data ,AOF Than RDB Safer and bigger ,RDB Performance ratio AOF good , If both have priority loading AOF.
边栏推荐
- “罚点球”小游戏
- The mail command is used in combination with the pipeline command statement
- JS implementation force deduction 71 question simplified path
- 【DSP】【第一篇】开始DSP学习
- Comprehensive evaluation and recommendation of the most comprehensive knowledge base management tools in the whole network: flowus, baklib, jiandaoyun, ones wiki, pingcode, seed, mebox, Yifang cloud,
- C language games - three chess
- Laravel notes - add the function of locking accounts after 5 login failures in user-defined login (improve system security)
- Mtcnn face detection
- 硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
- JMeter server resource indicator monitoring (CPU, memory, etc.)
猜你喜欢
APS taps home appliance industry into new growth points
What programming do children learn?
看过很多教程,却依然写不好一个程序,怎么破?
Laravel笔记-自定义登录中新增登录5次失败锁账户功能(提高系统安全性)
【每周一坑】正整数分解质因数 +【解答】计算100以内质数之和
使用.Net分析.Net达人挑战赛参与情况
PHP online examination system version 4.0 source code computer + mobile terminal
Deep learning classification network -- zfnet
Database - how to get familiar with hundreds of tables of the project -navicat these unique skills, have you got it? (exclusive experience)
Gui Gui programming (XIII) - event handling
随机推荐
Database - how to get familiar with hundreds of tables of the project -navicat these unique skills, have you got it? (exclusive experience)
[diy] how to make a personalized radio
[weekly pit] output triangle
Logic is a good thing
Reinforcement learning - learning notes 5 | alphago
2022 portal crane driver registration examination and portal crane driver examination materials
Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache
Spiral square PTA
Web开发小妙招:巧用ThreadLocal规避层层传值
Comment faire une radio personnalisée
Learn to punch in Web
正则表达式收集
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
“罚点球”小游戏
2022 refrigeration and air conditioning equipment installation and repair examination contents and new version of refrigeration and air conditioning equipment installation and repair examination quest
Can novices speculate in stocks for 200 yuan? Is the securities account given by qiniu safe?
PG基础篇--逻辑结构管理(事务)
Distributed ID
Pytest (3) - Test naming rules
【OpenCV 例程200篇】220.对图像进行马赛克处理