当前位置:网站首页>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
边栏推荐
- Notes Series docker installation PostgreSQL 14
- 笔记系列之docker安装Postgresql 14
- 李宏毅机器学习组队学习打卡活动day01---机器学习介绍
- B1026 program running time
- JVM Part 1: memory and garbage collection part 11 -- execution engine
- Explore the mysteries of the security, intelligence and performance of the universal altek platform!
- JVM Part 1: memory and garbage collection part 7 -- runtime data area heap
- 如何查看导师的评价
- B1024 scientific counting method
- Prime number screening (Ehrlich sieve method, interval sieve method, Euler sieve method)
猜你喜欢

Simplify the mybits framework of JDBC

JVM Part 1: memory and garbage collection part 8 - runtime data area - Method area

用户的管理-限制

2021 OWASP top 5: security configuration error

Pytorch data type and numpy data are mutually transformed

JVM Part 1: memory and garbage collection part 12 -- stringtable

Derivation and explanation of PBR physical illumination calculation formula

ERROR! MySQL is not running, but PID file exists

Graph cuts learning

idea远程调试debug
随机推荐
During its low-level period, this slave edge causes the instruction number to make a corresponding model
String class
Explore the mysteries of the security, intelligence and performance of the universal altek platform!
Bean的生命周期&&依赖注入*依赖自动装配
Three waiting methods of selenium and three processing methods of alert pop-up
2022 Zhengzhou light industry Freshmen's competition topic - I won't say if I'm killed
JVM Part 1: memory and garbage collection part 10 - runtime data area - direct memory
李宏毅机器学习组队学习打卡活动day04---深度学习介绍和反向传播机制
How to quickly and effectively solve the problem of database connection failure
35. Scroll
Differences and examples between internal classes and static internal classes
李宏毅机器学习组队学习打卡活动day05---网络设计的技巧
Flask登录实现
Day4 --- Flask 蓝图与Rest-ful
Alphabetic order problem
redis事务
Gradio quickly builds ml/dl Web Services
JVM上篇:内存与垃圾回收篇--运行时数据区四-程序计数器
如何查看导师的评价
注册功能实现