当前位置:网站首页>Redis persistence RDB
Redis persistence RDB
2022-07-26 05:37:00 【Life goes on and battles go on】
Redis Is a memory database , If you do not save the database state in memory to disk , So once the server process exits , The database state in the server also disappears , therefore Redis Provides persistence
RDB(Redis DataBase)
What is? RDB
Write the data set snapshot in memory to disk within the specified time interval , That's what jargon says Snapshot snapshot , It will recover soon Read the file directly into memory .
Redis Will create... Separately (fork) A subprocess to persist , Write the data to a temporary file first , Process to be persisted It's all over , Replace the last persistent file with this temporary file . The whole process , The main process is not going to do anything IO Operation of the . This ensures extremely high performance . If large-scale data recovery is needed , And it's not very sensitive to the integrity of data recovery , that RDB The way is better than AOF It's more efficient .RDB The disadvantage is that the data may be lost after the last persistence .
Fork
Fork Its function is to copy the same process as the current process . All the data for the new process ( Variable , environment variable , Program counter, etc ) The values are consistent with the original process , But it's a whole new process , And as a child of the original process .
rdb The saved file is dump.rdb

Configuration location and location SNAPSHOTTING analysis

The trigger condition mechanism here , We can modify and test :
save 120 10 # 120 Seconds to modify 10 Times trigger RDB
- save Just keep it , Whatever else , All blocked
- bgsave,Redis The snapshot operation will be performed asynchronously in the background , The snapshot can also respond to client requests . Can pass lastsave Command gets the last time the snapshot was executed successfully .
127.0.0.1:6379> config get dir
1) "dir"
2) "/www/server/redis"

边栏推荐
- sdc中对cdc的处理方式
- A trick to teach you to easily understand Potter's map
- Circular structure practice
- TZC 1283: simple sort - Comparative sort
- Unity Profiler
- 10. Regular expression matching
- How to understand "array name is essentially an address" from the perspective of memory parsing?
- 电机控制专栏文章汇总
- Redis持久化-AOF
- How to conduct test case review
猜你喜欢

OD-Paper【1】:Rich feature hierarchies for accurate object detection and semantic segmentation

MBA-day29 算术-绝对值初步认识

Lesson 2 getting to know slam for the first time

FTP实验及概述

Mongondb API usage

【STM32系列汇总】博主的STM32实战快速进阶之路(持续更新)

LNMP architecture

CANoe-XML在Test Modules中的应用

520送什么?DIY一个高颜值RGB时钟,女生看了都想要

FPGA question brushing sequence detection
随机推荐
Hack The Box - Web Requests Module详细讲解中文教程
OD-Paper【2】:Fast R-CNN
高手是怎样炼成的?
Mongondb API usage
TZC 1283: simple sorting - function method
SSTI payload and various bypass methods
MBA-day28 数的概念-练习题
嵌入式通用学习路线整理
SQL注入
Thread三种实现方式 和 Handler的用法
Development to testing: a six-year road to automation from scratch
FTP experiment and overview
中文文本纠错任务简介
Okaleido launched the fusion mining mode, which is the only way for Oka to verify the current output
Usage and common problems of SIP softphone registered with SIP account
87. Disturb string
sdc中对cdc的处理方式
开发项目事半功倍,一款开源的stm32驱动库大集合
攻防世界--easy_web
芯片的翻新和造假,人被坑麻了