Redis Persistent RDB

Source: Internet
Author: User
Tags save file

Two persistence mechanisms of RDB and AOF

Rdb:snapshot---the stored format is in binary format, is the default persistence mode, and periodically saves data from memory to disk by a pre-defined policy: Data file defaults to Dump.rdb

So there are two types of RDB storage mechanisms:

A. Clients can also use the Save or Bgsave command explicitly to start the snapshot save mechanism

B. Saving using a Save policy in a configuration file

Save: Saves the snapshot in the main thread and blocks all client requests (if there is a large amount of data in memory, it will block the customer request for a long time)

Bgsave: Asynchronously saved, the main process is not blocked, does not affect the client's request, and when it is saved, it will fork out a child process to write the in-memory snapshot to disk;

RDB disadvantage: In the event of an unexpected shutdown or power outage, data will be lost, the data is lost after the last snapshot

Default save (snapshot) policy

Save 900 1

Save 300 10

Save 60 10000

Save "": Empty inside quotation marks, indicating the ability to turn off the RDB

Stop-writes-on-bgsave-error Yes: The default is yes when an error occurs while the backup is stopped

Rdbcompression Yes: If the Rdb file is compressed to save space (compression consumes CPU), the default is Yes

Rdbchecksum Yes: Check code detection for RDB image file (for error detection), default Yes

Dbfilename Dump.rdb:rdb Storage file name, default is Dump.rdb

Dir:rdb File Save File location


This article is from the "burning Years of Passion" blog, please be sure to keep this source http://liuzhengwei521.blog.51cto.com/4855442/1931465

Redis Persistent RDB

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.