当前位置:网站首页>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.
边栏推荐
- [asp.net core] set the format of Web API response data -- formatfilter feature
- 【每周一坑】信息加密 +【解答】正整数分解质因数
- 基于STM32单片机设计的红外测温仪(带人脸检测)
- Event center parameter transfer, peer component value transfer method, brother component value transfer
- #yyds干货盘点#重新梳理箭头函数的this
- 【DSP】【第一篇】开始DSP学习
- 【微信小程序】运行机制和更新机制
- User defined current limiting annotation
- [weekly pit] calculate the sum of primes within 100 + [answer] output triangle
- 2110 summary of knowledge points and common problems in redis class
猜你喜欢

Web security - payload

使用.Net分析.Net达人挑战赛参与情况

C language operators
![[diy] how to make a personalized radio](/img/fc/a371322258131d1dc617ce18490baf.jpg)
[diy] how to make a personalized radio

Kubernetes learning summary (20) -- what is the relationship between kubernetes and microservices and containers?

使用.Net驱动Jetson Nano的OLED显示屏
![[DIY]自己设计微软MakeCode街机,官方开源软硬件](/img/a3/999c1d38491870c46f380c824ee8e7.png)
[DIY]自己设计微软MakeCode街机,官方开源软硬件
Tencent byte and other big companies interview real questions summary, Netease architects in-depth explanation of Android Development
![[DIY]如何制作一款个性的收音机](/img/fc/a371322258131d1dc617ce18490baf.jpg)
[DIY]如何制作一款个性的收音机

"Penalty kick" games
随机推荐
Boder radius has four values, and boder radius exceeds four values
Spiral square PTA
Mtcnn face detection
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,
Zoom with unity mouse wheel: zoom the camera closer or farther
01 basic introduction - concept nouns
【每周一坑】计算100以内质数之和 +【解答】输出三角形
Reinforcement learning - learning notes 5 | alphago
New database, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, Feishu multidimensional table, heipayun, Zhixin information, YuQue
[DIY]如何制作一款个性的收音机
知识图谱之实体对齐二
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]
User defined current limiting annotation
Extraction rules and test objectives of performance test points
Recyclerview not call any Adapter method :onCreateViewHolder,onBindViewHolder,
全网最全的新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
Variable star --- article module (1)
Yyds dry goods count re comb this of arrow function
动态切换数据源
全网最全的知识库管理工具综合评测和推荐:FlowUs、Baklib、简道云、ONES Wiki 、PingCode、Seed、MeBox、亿方云、智米云、搜阅云、天翎