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

  • The instance is a performance-enhanced instance of the ApsaraDB for Redis Enhanced Edition (Tair). For more information about performance-enhanced instances, see Performance-enhanced instances.
  • The instance uses the standard architecture or the cluster architecture. For more information about standard instances and cluster instances, see Standard master-replica instances and Cluster master-replica instances.
  • The minor version of the instance is the latest. For more information, see Update the minor version.
    Note If the Upgrade Minor Version button is dimmed, the minor version is the latest.

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.

Note If you restore data to the original instance, the key that you want to restore is written back to the original instance, which may increase the queries per second (QPS) or latency of the original instance. We recommend that you restore data during off-peak hours.
Figure 1. Two modes of data flashback
Two modes of data flashback

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 be changed 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 that you can restore data to 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 requires about 10 minutes for the system to upload data and logs.

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.

Note If you use the data flashback feature to restore data to a new instance, the system creates an instance and restores data to the instance. You must pay for the new instance. You can set the billing method of the new instance to pay-as-you-go and release the instance after it is no longer needed. For more information, see Billable items and prices.

Enable the data flashback feature

  1. 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 is deployed. Then, find the instance and click the instance ID.
  2. In the left-side navigation pane, click Backup and Recovery.
  3. On the Backup and Recovery page, click the Data Flashback tab.
  4. Click Enable Now.
    Note If the appendonly parameter is set to no, AOF persistence is disabled. In the dialog box that appears, you are prompted to enable the AOF feature. For more information about how to enable the AOF feature, see Modify parameters of an instance.

Perform data flashback

  1. 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 is deployed. Then, find the instance and click the instance ID.
  2. In the left-side navigation pane, click Backup and Recovery.
  3. On the Backup and Recovery page, click the Data Flashback tab.
  4. Click Start Flashbacking. In the dialog box that appears, set the flashback parameters.
    Figure 2. Perform data flashback
    Perform data flashback
    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 matches hllo or heeeello.
      • Question mark (?): matches zero or one occurrence of a preceding subexpression. For example, h.?llo matches hllo or hello.
      • Character set [Characters]: matches a character included in the brackets ([ ]). For example, h[ae]llo matches hallo or hello.
      • Negative character set [^Characters]: does not match a character in the brackets ([ ]). For example, h[^ae]llo matches hcllo or hdllo, but not hallo or hello.
      • Character range [Character1-Character2]: matches a character in the range of Character1 to Character2. For example, h[a-b]llo matches hallo and hbllo.
      Note To ensure the efficiency of data restoration, we recommend that you specify no more than 10 keys or specify no more than three regular expressions.
    Restoration mode
    • New instance: restores data to a new instance.
    • The original instance: restores data to the current instance. If you set the Flashback data parameter to Specify Key, only the data of the specified keys can be restored to the specified point in time and other keys are not affected.
    Flashback Time Point The point in time to which you want to restore data.
    Note If you set the Recovery mode parameter to The original instance, you must specify this parameter. If you set the Recovery mode parameter to New instance, the Clone Instance page appears. You must specify the point in time to which you want to restore data on this page.
  5. Click OK.
    • If you set the Recovery mode parameter to The original instance, 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 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 architecture of the new instance must be standard or cluster, and the capacity of the new instance must be greater than or equal to that of the original instance. For more information about instance parameters, see Create an ApsaraDB for Redis Community Edition instance or a performance-enhanced instance of ApsaraDB for Redis Enhanced Edition (Tair).

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.