当前位置:网站首页>Persistence of redis
Persistence of redis
2022-07-23 07:25:00 【shuiloge】
RDB
advantage : For disaster recovery , Commonly used to back up files ( Multithreaded representation ) Allow the use of big data Faster restart , The file is relatively small , Improve redis performance
shortcoming : Caused by emergencies redis Stopping will lose data , The last persistent data may be lost , Memory consumption
save “” Means closing rdb
How to trigger a snapshot
perform flushall command , There will be dump.rdb file , But it's empty , meaningless
Be careful not to manually operate in the production environment save Taking pictures
Restore data
Will back up files (dump.rdb) Move to redis Install the directory and start the service
CONFIG GET dir Get directory
AOF
principle : Log every write operation in the form of a log , take Redis All written instructions executed are recorded ( Reading operation does not record ), Only files can be added but not rewritten ,redis At the beginning of startup, it will read the file and rebuild the data , In other words ,redis In case of restart, execute the write instruction from the front to the back according to the contents of the log file to complete the data recovery
Aof What is kept is appendonly.aof file
appendonly The default is no yes Open for indication aof Persistence
advantage : Higher data integrity , append mode , File rewriting is possible You can open it directly to watch
shortcoming : Larger files , Performance may lead to poor , The data may have bug, Maybe the data will be different
How to choose
- Cache only (RDB)
- Do user login and save session conversation (RDB+AOF)
- The ultimate pursuit of performance ( close RDB, Open copy )
- Ultimate pursuit of safety (RDB+AOF (appendfsync always))
边栏推荐
- 对线程池的了解与应用你掌握多少
- AE常用表达式汇总「建议收藏」
- Redis basic type common commands
- 如何关闭电脑乱七八糟的弹窗 电脑禁止一切弹窗广告设置教程
- 基于API调用管理的SDN应用层DDoS攻击防御机制
- 网络空间拟态防御发展综述:从拟态概念到“拟态+”生态
- 你的 NFT 会消失吗?DFINITY 提供 NFT 存储最佳方案
- 局域网SDN技术硬核内幕 13 二 从局域网到互联网
- 聪明人的游戏提高篇:第三章第二课:因子个数(factor)
- How to open the tutorial of administrator permission setting for computer administrator permission
猜你喜欢
随机推荐
常见的跨域问题
Research on security situation awareness method of Internet of things based on evidence theory
FileInputFormat.setInputPaths多路径读取规则
Detailed explanation of CAN bus
EXCEL单元格公式-实现阿克曼函数计算
Null and nullptr
Computer prompts how to deal with insufficient memory. The solution of insufficient computer C disk
How to turn off the messy pop-up windows on the computer? A tutorial on setting up pop-up advertisements
ESP32:Arduino教程汇总
What if the software downloaded from the computer is not displayed on the desktop? Solve the problem that the installed software is not on the desktop
GNU pseudo instruction definition function
Nftscan and ATEM network have reached strategic cooperation in the field of NFT data
Inside the hard core of LAN SDN technology - 14 three from things to people - SDN enters the campus network
CAN总线详解
Interface Fiddler introduction and installation
DataGrip使用教程(GIF版)
国泰君安证券股票开户怎么样安全吗
redis常用基础配置文件
-bash: wget: 未找到命令
基于以太坊状态数据库的攻击与防御方案









