当前位置:网站首页>Redis RDB快照
Redis RDB快照
2022-07-01 22:58:00 【Mar丶流年】
2个生成快照的命令
save 在主线程中进行,会阻塞主线程
bgsave 创建子进程执行快照任务
全量快照
对所有数据做快照
增量快照
在上一次的全量快照上基础上进行更改
假设在t0时刻做了全量快照
在t1时刻进行了更改数据操作
在t2做快照就需要知道t1时刻干了什么
做增量备份是需要额外的开销来记录数据的更改操作
全量快照 + AOF
redis 4 以后提供了像mysql一样的 快照 + 日志 来恢复数据
快照的读写处理
假设redis数据量比较大,t0时刻 数据 A = 10
t0时刻做快照,快照耗时10分钟,完后后的快照中A应该等于10
如果第九分钟将A改成9。怎么保证快照的结果A = 10
让redis写操作,等待快照是不现实的
redis解决这个问题,采用了操作系统的写时复制
在做快照时,子进程拷贝主线程的内存的必要数据,并指向相同的内存空间,共用同一数据。
当主线程中redis修改数据时,会重新分配一个内存空间(副本),原始数据拷入副本供给子进程使用
边栏推荐
- The online beggar function of Japanese shopping websites
- Timer和ScheduledThreadPoolExecutor的区别
- Huisheng Huiying 2022 intelligent, fast and simple video editing software
- 众昂矿业:发展以氟化工为主的特色化工产业具有先天优势
- 2021 RoboCom 世界机器人开发者大赛-高职组复赛
- SWT / anr problem - SWT causes kernel fuse deadlock
- Notes on problems - /usr/bin/perl is needed by mysql-server-5.1.73-1 glibc23.x86_ sixty-four
- Y53. Chapter III kubernetes from introduction to mastery -- ingress (26)
- 共享电商的背后: 共创、共生、共享、共富,共赢的共富精神
- typescript枚举
猜你喜欢
Matplotlib常用设置
[MySQL] basic use of explain and the function of each column
2021 RoboCom 世界机器人开发者大赛-高职组初赛
实在RPA:银行数字化,业务流程自动化“一小步”,贷款审核效率“一大步”
Use 3DMAX to make a chess piece
Know --matplotlib
Jielizhi Bluetooth headset quality control and production skills [chapter]
Matplotlib常用图表
mt管理器测试滑雪大冒险
Istio、eBPF 和 RSocket Broker:深入研究服务网格
随机推荐
Know --matplotlib
微信个人小商店一键开通助手小程序开发
日本购物网站的网络乞丐功能
Understanding threads
Development trend and future direction of neural network Internet of things
物联网现状及未来发展趋势
dat. GUI
What is the difference between memory leak and memory overflow?
Redis数据类型和应用场景
Current situation and future development trend of Internet of things
Aaai22 | structural tagging and interaction modeling: a "slim" network for graph classification
The online beggar function of Japanese shopping websites
Programming English vocabulary notebook
Stm32f030f4 drives tim1637 nixie tube chip
Future trend and development of neural network Internet of things
【小程序】通过scroll-view组件实现左右【滑动】列表
2022 safety officer-c certificate examination question simulation examination question bank and simulation examination
What is the mosaic tailgate?
SWT/ANR问题--SWT 导致 low memory killer(LMK)
Leetcode (34) -- find the first and last positions of elements in a sorted array