Redis persistence mode RBD and aof contrast

Source: Internet
Author: User
Tags redis time interval

The persistence mechanisms of Redis include the RBD and AoF two, which are described in this article for each of these two persistence approaches.


the strategy of the RDB mechanism

RDB persistence refers to the way in which in-memory data and operations are saved to the Redis Bin directory at a specified time interval by default named Dump.rdb files, which can be configured to set automatic snapshot persistence, we can configure the time that Redis takes to snapshot in n seconds, and if this time node is exceeded, the snapshot operation will be performed automatically. Although this method is convenient and fast, but can not guarantee the absolute security of the data, if the server in the non-backup time span of failure, can not do real-time preservation of the current state, resulting in data loss. And every time you save an RDB file, Redis needs to fork () out a child process to perform the specific persistence work and consume a large resource.


strategy of AOF mechanism

The AOF persistence of Redis is appended to the file by the Write function on each command (the default is APPENDONLY.AOF), but because the operating system uses a cache to write to the file to improve write efficiency, or there may be data loss due to a sudden server failure, we can tell Redis our time interval for synchronizing data through a configuration file (the default interval is synchronous once per second)

AppendOnly Yes              //enable AOF Persistence
# Appendfsync      always//force write to disk as soon as you receive the Write command, slowest, but guaranteed full persistence,
deprecated Appendfsync everysec     //force write to disk once per second, a good compromise in performance and persistence, recommended
# Appendfsync no    //full OS-dependent, best performance, no guarantee of durability



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.