Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

RDB of redis persistence

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Rdb and aof persistence mechanisms

RDB:snapshot-- > Storage format is binary format, which is the default persistence method. According to the policy customized in advance, the data is periodically read from memory to disk: the data file defaults to dump.rdb.

So there are two rdb preservation mechanisms:

a. The client can also explicitly start the snapshot save mechanism using the save or bgsave command

b. Save using the save policy in the configuration file

Save: saved synchronously; save the snapshot in the main thread, which will block all client requests (if there is a large amount of data in memory, it will block customer requests for a long time)

Bgsave: saved asynchronously; the main process will not be blocked and will not affect the client's request; when saving, a child process will be fork to write the snapshot in memory to disk

Rdb disadvantages: in the case of accidental shutdown or power outage, the data will be lost, and the lost data will be the data after the last snapshot.

Default save (snapshot) policy

Save 900 1

Save 300 10

Save 60 10000

Save "": blank inside quotation marks, indicating that rdb function is turned off

Stop-writes-on-bgsave-error yes: whether an error occurs during backup is stopped. Default is yes.

Rdbcompression yes: whether to compress rdb files to save space (compression consumes cpu). Default is yes.

Rdbchecksum yes: whether to check the rdb image file with a check code (used to detect whether an error occurs). Default is yes.

The name of the storage file of dbfilename dump.rdb:rdb, which defaults to dump.rdb

Dir:rdb file save file location

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report