After the data flashback feature is enabled, you can restore the data of an instance or a specified key to a point in time that is accurate to seconds from an unexpired backup file. You can restore data to a new instance or the original instance. Such a refined data restoration capability can protect business data and prevent data loss that is caused by accidental operations to the greatest extent.
Prerequisites
- An ApsaraDB for Redis Enhanced Edition (Tair) persistent memory-optimized or DRAM-based instance that is compatible with Redis 5.0 is created.
- The instance uses the standard or cluster architecture.
Data flashback introduction
To protect your business data in the cloud, ApsaraDB for Redis Enhanced Edition (Tair) provides the data flashback feature in addition to the data backup and restoration features based on Redis Database (RDB) snapshots. ApsaraDB for Redis Enhanced Edition (Tair) optimizes the persistence mechanism based on append-only-files (AOFs) and incrementally archives AOFs so that data can be restored to a point in time accurate to seconds. This facilitates O&M and allows you to use ApsaraDB for Redis Enhanced Edition (Tair) for persistent storage.
After the data flashback feature is enabled, you can restore the data of an instance or a specified key to a point in time that is accurate to seconds from an unexpired backup file. The maximum retention period of backup files is seven days. You can restore data to a new instance or the original instance. Such a refined data restoration capability can protect business data and prevent data loss that is caused by accidental operations to the greatest extent.

Limits
- You can restore data only to a specific point in time that is in the time range from when data flashback is enabled to the current time. This period can be up to seven days.
- After the data flashback feature is enabled, the point in time for data backup may change due to configuration changes, cross-zone migrations, or minor version upgrades. For example, if you change the configurations of an instance, the point in time to which you can restore data starts from the time when the configuration change is complete. Note If you change the architecture of an instance (such as from standard to cluster), date flashback is disabled for the instance. To use data flashback, you must re-enable the feature.
- After you enable the data flashback feature, it takes a specific amount of time for the system to upload data and logs before you can use the feature.
- Only full data can be restored for cloud disk-based instances.
Billing
During the trial period of the data flashback feature, you can restore data to a point in time within the last seven days free of charge. After the official release, this feature is charged based on points in time of restoration. For more information, see this topic or the announcement on the Alibaba Cloud website.
Enable the data flashback feature
- Log on to the ApsaraDB for Redis console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click its ID.
- In the left-side navigation pane, click Backup and Recovery.
- On the Backup and Recovery page, click the Data Flashback tab.
- Click Enable Now. After you enable the data flashback feature, it takes a specific amount of time for the system to upload data and logs before you can use the feature. The console displays an expected point in time when the upload is complete.Important You can restore only data that is written to the instance after data flashback is enabled.
Perform data flashback
- Log on to the ApsaraDB for Redis console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click its ID.
- In the left-side navigation pane, click Backup and Recovery.
- On the Backup and Recovery page, click the Data Flashback tab.
- Click Start Flashbacking. In the dialog box that appears, set the parameters described in the following table.
Parameter Description Flashback data - Full data: All data on the instance is restored.
- Specify Key: Specify one or more keys whose data you want to restore. Each key name occupies a line. You can specify regular expressions based on the following rules:
- Period (.): matches a single character except
'\r\n'
. - Asterisk (*): matches zero or more occurrences of a preceding subexpression. For example,
h.*llo
matcheshllo
orheeeello
. - Question mark (?): matches zero or one occurrence of a preceding subexpression. For example,
h.?llo
matcheshllo
orhello
. - Character set [Characters]: matches a character included in brackets [ ]. For example,
h[ae]llo
matcheshallo
orhello
. - Negative character set [^Characters]: does not match a character in brackets [ ]. For example,
h[^ae]llo
matcheshcllo
orhdllo
, but nothallo
orhello
. - Character range [Character1-Character2]: matches a character in the range of
Character1 to Character2
. For example,h[a-b]llo
matcheshallo
andhbllo
.
Note To ensure the efficiency of data restoration, we recommend that you specify no more than 10 keys or specify no more than three keys that use regular expressions. - Period (.): matches a single character except
Recovery mode - New instance (the new instance contains only the specified Key data): restores data to a new instance.
- The original instance (specify the Key for data recovery, and the rest of the data remains unchanged): restores data to the current instance. Warning
You can restore data to the original instance only if you set Flashback data to Specified Key.
The specified keys are deleted. Tair restores the specified keys to the specified time point from the backup file. This has no impact on other keys in the instance.
Flashback Time Point The point in time to which you want to restore data. Handle Expired Keys - Default: No operations are performed on the expiration time of keys. If a key expires before you submit the data restoration task, the key cannot be restored.
- Time Offset: specifies the expiration offset time point of a key. You must also specify the Offset Time parameter. The key expires after the remaining validity period of the key elapses based on the expiration offset time point.For example, assume that you restore the
foo
key at 10:30 on December 12, 2022 and set Flashback Time Point to December 12, 2022, 10:00:00, and the remaining validity period of thefoo
key is 10 seconds. In this case, if you set Offset Time to December 12, 2022, 10:30:00, thefoo
key expires at 10:30:10 on December 12, 2022.Note The offset time point must be between the specified flashback time point and the time when the data restoration task is submitted.
- Click OK.
- If you set the Recovery mode parameter to The original instance (specify the Key for data recovery, and the rest of the data remains unchanged), the current instance enters the Restoring state. Wait until the instance state changes to Running.
- If you set the Recovery mode parameter to New instance (the new instance contains only the specified Key data), the Clone Instance page appears. You must specify the point in time to which you want to restore data and the configurations of the new instance on this page. Note The new instance must be of the standard or cluster architecture, and the capacity of the new instance must be greater than or equal to that of the current instance. For more information about instance parameters, see Create an ApsaraDB for Redis instance that uses local disks.
Related API operations
Operation | Description |
---|---|
RestoreInstance | Restores the data of an ApsaraDB for Redis instance from a backup file to the instance. If you use this operation together with the data flashback feature, you can restore data of a specified key to a specified point in time that is accurate to seconds. |