Redis Persistent RDB

Source: Internet
Author: User
Tags set time

?
Persistence: Redis is storing data in memory, persistence is storing data in the hard disk, and Redis's RDB persistence is storing the data in a file that ends in an RDB
Persistence of some other databases:
The Mysql:mysql database is a notification operation when the action log is generated and then the data is recovered through the log
Memcached: Can now be persisted through master-slave replication

Redis implements RDB persistence by saying that n Key,redis written every n minutes will take data from memory to generate RDB files (snapshots of datasets) and then compress them into the backup file directory. When the last server starts again
Restore the dataset by re-executing the commands.
The persistent operation steps of the RDB for Redis: Mainly modify the redis.conf configuration file
1.save settings
Save 900 1? If at least one key is written to the Rdb file after 900 seconds
Save 300 10 writes to an RDB file if at least 10 keys are written in 300 seconds
Save 60 10000 writes to an RDB file if at least 10,000 keys are written in 60 seconds
2.stop-writes-on-bgsave-error Yes
Background Store Error Stop write
3.rdbcompression Yes
Compressing an RDB file using Lzf
4.rdbchecksum Yes
Storing and loading an RDB file is a checksum
5.dbfilename Dump.rdb
Set the name of an RDB file
6.dir./
Set the directory generated by the Rdb file

Advantages of RDB: RDB persistence can generate very compact, easy-to-save files that can be quickly recovered at any time and are ideal for disaster recovery.
? RDB disadvantage: Although the RDB persistence can save the dataset well, the set time period may conflict with the server down time, resulting in a partial loss of data.

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.