The difference between the RDB and aof persistence for Redis

Source: Internet
Author: User
Tags redis

Aof,rdb is a mechanism for two types of redis persistence. Used for the recovery of Redis after a crash.

The features of the RDB are as follows:

Code:

Fork a process, traverse hash table, and use copy on write to save the entire db dump .
Save, shutdown, slave command will trigger this operation.
particle size ratio is large, if save, shutdown, slave before crash, then the middle of the operation has no way to recover .

AOF has the following characteristics:

Code:

Write the instructions, continue to write to a similar log file. (similar to exporting SQL from databases such as PostgreSQL, only write operations are logged)

Can be set to backup every second. the value of Appendfsync is set to everysec

The granularity is small, after crash, only then crash did not have time to do the log the operation cannot recover.

The two differences are that one is the continuous use of log records to write operations, crash after the use of log recovery ; One is usually write operations do not trigger the write, only manually submit the Save command, or close the command, only trigger the backup operation .

The standard of choice is to see if the system is willing to sacrifice some performance in exchange for higher cache consistency (aof), or is willing to write frequently, do not enable backup in exchange for higher performance, when manually run save, then do Backup (RDB). The RDB is a bit more eventually consistent .


So master Redis aof in exchange for higher cache consistency , No backup from Redis RDB for higher performance

The difference between the RDB and aof persistence for Redis

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.