当前位置:网站首页>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.
边栏推荐
- Event center parameter transfer, peer component value transfer method, brother component value transfer
- 【每周一坑】信息加密 +【解答】正整数分解质因数
- 为什么新手在编程社区提问经常得不到回答,甚至还会被嘲讽?
- 解剖生理学复习题·VIII血液系统
- Web开发小妙招:巧用ThreadLocal规避层层传值
- 【每周一坑】输出三角形
- 过程化sql在定义变量上与c语言中的变量定义有什么区别
- 15 millions d'employés sont faciles à gérer et la base de données native du cloud gaussdb rend le Bureau des RH plus efficace
- Leetcode hot topic Hot 100 day 32: "minimum coverage substring"
- 小孩子学什么编程?
猜你喜欢
设计你的安全架构OKR
Comment faire une radio personnalisée
C language operators
【DSP】【第二篇】了解C6678和创建工程
Gui Gui programming (XIII) - event handling
使用.Net分析.Net达人挑战赛参与情况
1500萬員工輕松管理,雲原生數據庫GaussDB讓HR辦公更高效
请问sql group by 语句问题
Design your security architecture OKR
2022 nurse (primary) examination questions and new nurse (primary) examination questions
随机推荐
[weekly pit] positive integer factorization prime factor + [solution] calculate the sum of prime numbers within 100
What key progress has been made in deep learning in 2021?
【DSP】【第二篇】了解C6678和创建工程
PG基础篇--逻辑结构管理(事务)
The mail command is used in combination with the pipeline command statement
知识图谱构建流程步骤详解
Error analysis ~csdn rebound shell error
Basic knowledge of lists
动态切换数据源
设计你的安全架构OKR
How to select several hard coded SQL rows- How to select several hardcoded SQL rows?
【每周一坑】计算100以内质数之和 +【解答】输出三角形
I've seen many tutorials, but I still can't write a program well. How can I break it?
Taylor series fast Fourier transform (FFT)
Redis insert data garbled solution
全网最全的知识库管理工具综合评测和推荐:FlowUs、Baklib、简道云、ONES Wiki 、PingCode、Seed、MeBox、亿方云、智米云、搜阅云、天翎
Rhcsa Road
【OpenCV 例程200篇】220.对图像进行马赛克处理
02 basic introduction - data package expansion
使用.Net分析.Net达人挑战赛参与情况