当前位置:网站首页>Redis persistence
Redis persistence
2022-07-27 05:28:00 【A dream without trace BZY】
One 、 Persistence concept
Persistence has a wide range , From memory to hard disk, this is called persistence ; Data backup is also called persistence ( therefore mysql It's also persistent )
Two 、redis Persistent classification
1、RDB: Take a snapshot
Update the data every time point . The occupied volume is relatively small 、 Fast recovery ; But the data loss may be great ( Default RDB, It can be turned on manually AOF, Once on AOF You will no longer read snapshot files, but only log files )
2、AOF: journal
Close to real-time updates ( This is configurable ). The occupied volume is relatively large 、 Slow recovery ; But data loss may be small
AOF Two modes :
- Real time updates : Write and update the log . because redis It is a single thread. If it is completely real-time, the efficiency will be very low , Every time you write data to memory, you have to write it to hard disk , Then you can process other requests
- hand os: The operating system is based on pagecache( Page caching ) To update , every other 5s Update and reach 10% memory update , These two work together . Data will be lost but no RDB serious )
Because it's a log , So every update operation will be recorded , But the last record is actually useful , So the volume is big 、 Slow recovery . But you can configure rewriting to update useless information , However, this is not real-time, but there are trigger conditions, such as extremely large or to a certain point in time . here we are 4.x After the version AOF Improved , When it comes to rewriting , It does not loop through and delete useless information , It takes snapshots directly in memory , Put the snapshot directly into AOF Replace the original record ( Delete the original directly ), Then new
边栏推荐
猜你喜欢

idea远程调试debug

Pinball games

Alphabetic order problem

李宏毅机器学习组队学习打卡活动day01---机器学习介绍

Raspberry pie RTMP streaming local camera image

34. Analyze flexible.js

torch中乘法整理,*&torch.mul()&torch.mv()&torch.mm()&torch.dot()&@&torch.mutmal()

ERP system brand

JDBC API 详解

JVM Part 1: memory and garbage collection part 5 -- runtime data area virtual machine stack
随机推荐
李宏毅机器学习组队学习打卡活动day05---网络设计的技巧
Notes Series docker installation PostgreSQL 14
B1025 reverse linked list*******
MQ set expiration time, priority, dead letter queue, delay queue
B1021 single digit statistics
如何查看导师的评价
numpy 数据类型转化
Pytorch data type and numpy data are mutually transformed
2022年郑州轻工业新生赛题目-打死我也不说
Day4 --- Flask 蓝图与Rest-ful
Li Hongyi machine learning team learning punch in activity day03 --- error and gradient decline
内部类与静态内部类区别及举例
B1028 census
Li Hongyi machine learning team learning punch in activity day05 --- skills of network design
Raspberry pie RTMP streaming local camera image
Idea remote debugging
B1025 反转链表*******
B1026 程序运行时间
JVM上篇:内存与垃圾回收篇二--类加载子系统
用户的管理-限制