ApsaraDB for Redis offers high performance, high security, and high availability. In addition, this service provides diverse architectures. An increasing number of applications use 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 that was generated at a specific 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 Redis, the service reruns the commands in the AOF files 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 effect on the performance and can minimize data loss caused by user errors or power outages.
AOF persistence of DRAM-based instances
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 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
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 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. | |
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 DRAM-based instances of ApsaraDB for Redis Enhanced Edition (Tair). For more information about DRAM-based instances, see DRAM-based instances. |