All Products
Search
Document Center

Tair (Redis® OSS-Compatible):Backup and restoration

Last Updated:Apr 27, 2025

Backup (in-memory data persistence) refers to the storage of in-memory data to disks at regular intervals. In the event of business anomalies that lead to data loss or errors, the backup files can be used to restore the data. Tair (Redis OSS-compatible) provides the Redis Database (RDB), append-only file (AOF), and Tair-Binlog persistence policies to meet the backup and restoration requirements in various scenarios.

Persistence policies

RDB

RDB creates snapshots of the data stored in Redis at specified intervals, and saves the snapshots to disks in the form of RDB files. This way, data persistence is implemented. RDB files are small in size and easy to migrate. You can use RDB files to back up or migrate data of a specified point in time.

When open source Redis generates RDB files, operations in progress may be blocked. The blocking time varies based on the total amount of data in the instance. Tair (Redis OSS-compatible) optimizes the persistence mechanism and implements non-blocking backup. This optimization allows instance backup operations to occur without affecting client requests.

By default, Tair (Redis OSS-compatible) instances are configured to back up data automatically once a day. You can modify the automatic backup policy based on your business requirements or manually create a temporary backup.

AOF

AOF logs all write operations received, such as SET. As the number of entries in an AOF file grows, the instance starts an AOF rewrite process to reorganize the AOF file and reduce the disk usage of the AOF file.

The AOF persistence policy for Tair (Redis OSS-compatible) instances is AOF_FSYNC_EVERYSEC, which asynchronously writes the commands in the AOF buffer to disks every second. This policy helps reduce the performance impact of enabling AOF on the instance.

Tair-Binlog

Tair (Enterprise Edition) DRAM-based instances not only support the preceding two persistence policies, but also optimizes the AOF persistence mechanism to implement AOF incremental archiving. After optimization, AOFs can be archived incrementally to prevent performance degradation caused by AOF rewrite. Incremental archiving also allows data in an instance or a key to be restored to a point in time accurate to the second as this method saves each write operation and its timestamp. This data restoration process is called point-in-time recovery (PITR). For more information, see Use data flashback to restore data by point in time.

Backup and restoration solutions

Tair (Redis OSS-compatible) implements data backup and restoration based on RDB persistence, AOF persistence, and AOF incremental archiving.

Category

Solution

Description

Data backup

Automatic or manual backup

Tair (Redis OSS-compatible) supports data persistence. Instance data is automatically backed up according to the default backup policy (based on RDB). You can modify the automatic backup policy based on your business requirements or manually create a temporary backup.

Download a backup file

Backup files can be retained for 7 days. If you want to retain backup files for a longer period of time, you can download the backup files to your computer. For example, you may want to retain backup files for a longer period of time due to regulatory or information security requirements.

Data restoration

Restore data from a backup set to a new instance

Tair (Redis OSS-compatible) allows you to create an instance from a specified backup set. The data in the new instance is the same as that in the backup set. This feature is suitable for scenarios such as data restoration, quick workload deployment, and data verification.

Use data flashback to restore data by point in time

After you enable the data flashback feature (based on AOF), you can restore data of an instance to a specified point in time accurate to the second. This feature minimizes data loss caused by accidental operations and is suitable for scenarios in which data is frequently restored.

Note

This feature is available only for Tair (Enterprise Edition) DRAM-based instances.