Redis Ten Rdb of the last

Source: Internet
Author: User
Tags redis redis server
1 The meaning of Rdb

Redis provides RDB persistence, which keeps the Redis database state in memory on disk to avoid accidental loss of data. RDB persistence can be performed either manually or periodically based on server configuration options, which can save the state of a database at a point in time to a RDB file. The Rdb file generated by the RDB persistence feature is a compressed binary file that enables you to restore the state of the database when the generated RDB file is created. 2 rdb file loading

RDB files are loaded automatically when the server is started, so there are no commands specifically for loading RDB files, and whenever the Redis server detects RDB files at startup, it automatically loads RDB files.

Because aof files are often updated more frequently than RDB files, the following conditions exist:

1 if the server has AOF persistence enabled, the server will use the AoF file as a priority to restore the state of the database.

2 The server will use the Rdb file to restore the database state only if the AOF persistence feature is turned off.

Command

Characteristics

SAVE

When the command executes, the Redis server is blocked, so all command requests sent by the client are rejected when the Save command is executing.

Bgsave

The save work for the Bgsave command is performed by a subprocess, so the Redis server can still continue processing the client's command requests while the child process creates the Rdb file. Second, during the execution of the Bgsave command, the Save and Bgsave commands sent by the client are rejected by the server, and the server prevents the Save command and Bgsave from executing the rdbsave call simultaneously to prevent the parent and child processes from producing the competition conditions.

3 Rdb File Components

1) Five-byte "Redis" string

2) Four-byte version number (db_version)

3 A byte of EOF constant

4) eight-byte checksum

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.