ApsaraDB for Redis offers high performance, high security, high availability, and diverse architectures. An increasing number of applications run ApsaraDB for Redis as their database engine for persistent storage. ApsaraDB for Redis provides a variety of solutions that allow you to back up or restore data in different scenarios.

Persistence solutions

ApsaraDB for Redis supports the following persistence solutions:

  • RDB persistence

    ApsaraDB for Redis creates snapshots on a regular basis for the data stored in the engine storage, generates Redis database (RDB) files, and then saves the files to disks. This process is called RDB persistence. RDB files are small in size and easy to migrate. You can use RDB files to back up or migrate ApsaraDB for Redis data at a specified point in time.

    By default, ApsaraDB for Redis generates RDB snapshots on a daily basis and retains the snapshots for seven days.

  • AOF persistence

    ApsaraDB for Redis records all commands that write data, such as SET in logs. This process is called append-only file (AOF) persistence. When you restart an ApsaraDB for Redis instance, the system reruns the commands in the AOFs to restore data. If AOFs are larger than required, open source Redis runs an AOF rewrite task to recreate the AOFs at a reduced file size.

    You can specify the AOF_FSYNC_EVERYSEC policy to enable AOF persistence for ApsaraDB for Redis instances. After you specify this policy, the system records all write commands in an AOF every second and saves the AOF to disks. The policy has a negligible impact on the performance and can minimize data loss caused by accidental operations.

  • AOF persistence for performance-enhanced instances of the ApsaraDB for Redis Enhanced Edition (Tair)

    ApsaraDB for Redis Enhanced Edition (Tair) supports data backup and restoration based on RDB snapshots and optimizes AOF persistence. After optimization, AOFs can be archived incrementally to prevent performance degradation caused by AOF rewrite. Incremental archive 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. For more information, see Use data flashback to restore data by point in time.

Backup and restoration solutions

Category Solution implementation Description
Data backup Automatic or manual backup You can use ApsaraDB for Redis to persist data. Backups are automatically created based on the default backup policy.RDB You can modify the automatic backup policy or manually create a temporary backup.
Download a backup file Backup files of ApsaraDB for Redis are retained free of charge for seven days. If you want to retain backup files for more than seven days, you can download the backup files to your computer. For example, you may want to retain data for more than seven days due to regulatory or security requirements.
Use the redis-shake tool to back up data You can use redis-shake in dump mode to back up the data of an ApsaraDB for Redis instance in an RDB file and store the RDB file in your computer.
Data restoration Restore data from a backup set to a new instance ApsaraDB for Redis 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, AOF you can restore data of an ApsaraDB for Redis 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 supported only by performance-enhanced instances of the ApsaraDB for Redis Enhanced Edition (Tair). For more information about performance-enhanced instances, see Performance-enhanced instances.
Use redis-shake to restore data You can use redis-shake in restore mode to restore data from an RDB file to an ApsaraDB for Redis instance.