Redis Note--rdb Snapshot persistence

Source: Internet
Author: User

Persistence: Storing data in a device that is not lost after a power outage, usually a hard disk

How the RDB works:

After every n minutes or N writes, an RDB file is formed from the memory dump data, compressed , and placed in the backup directory (the red part can be configured by parameters)

RDB Snapshot Related parameters:

Save 1 #刷新快照到硬盘中, must meet the requirements of both participants trigger, that is, 900 seconds after at least 1 keywords change (3)

Save 300 10 # must be 300 seconds after at least 10 keywords changed (2)

Save 60 10000 # must be 60 seconds after at least 10,000 key words have changed, (1)

(all 3 options are masked, the RDB fails)

Stop-writes-on-bgsave-error Yes #后来存储错误停止写

Rdbcompression Yes #使用LZF压缩rdb文件

Rdbchecksum Yes #c存储和加载rdb文件时校验

Dbfilename Dump.rdb # setting RDB file name

Dir./# Set working directory, RDB file will be written to directory

The defect of the RDB

Between 2 save points, a power outage will lose 1-n minutes of data

For more granular requirements for persistence, Redis has added aof mode append only file

Working principle:

There is a redis-server process that has a rdbdump process that reaches the trigger condition in the work, calling the Rdbdump process. The trigger condition is monitored by the redis-server. Recovery is fast. Will lose data in a few minutes

Redis Note--rdb Snapshot persistence

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.