This topic describes how to use the data flashback feature provided by ApsaraDB for Redis. This allows you to restore data to a specific time point. During the retention period of backup files, data flashback provides a solution to restore data to a specific time point within the retention period. This feature allows you to meet the business requirements for frequent data restoration. It also allows you to avoid data loss caused by user errors.

Prerequisites

  • The engine version of the ApsaraDB for Redis instance is Redis 5.0 or later (Enhanced Edition).
  • The minor version of the instance is upgraded to the latest version. For more information, see Upgrade the minor version.
    Note If Upgrade Minor Version is disabled, the current minor version is the latest version.
  • The instance is a performance-enhanced instance.
  • The instance is a standard instance or cluster instance.
  • Append-only file (AOF) persistence is enabled. This is the default state. For more information, see AOF persistence.

Background information

ApsaraDB for Redis features high performance, flexible architecture, high data security, and high availability. An increasing number of applications use ApsaraDB for Redis as the database engine for persistent storage. Therefore, a reliable persistence mechanism and an accurate data restoration feature are required. You can use RDB snapshots for automatic or manual backup. ApsaraDB for Redis also optimizes the AOF persistence mechanism to perform incremental backups. This allows you to restore data within a few seconds and improve the efficiency of operations and maintenance (O&M).

After you enable the data flashback feature, the AOF backup data is retained for up to seven days. During the retention period, the system creates an instance and restores data to a specified time point that is accurate to seconds. This allows you to perform accurate data restoration.

Limits

  • You can restore data only to a specific time point during the period from the time when data flashback is enabled to the current time. This period can be up to seven days.
  • After data flashback is enabled, the time point for data backup may be changed due to configuration changes, zones migration, or minor version upgrades. For example, if you change the configurations of an instance, the time point that you can restore data starts from the time when the configuration change is complete.
  • After you enable data flashback, it requires about 10 minutes for the system to upload data and logs.

Pricing

Action Description
Enable data flashback Free of charge.
Perform data flashback
  • During the trial period of the data flashback feature, you can restore data to a time point within the last seven days free of charge. After the official release, this feature is charged based on the time point of restoration. For more information, see this topic or the feature updates on the Alibaba Cloud website.
  • The system creates an instance and restores the data to the instance. You need to pay for the newly created instance. For more information, see Billing items and pricing.

Procedure

  1. Log on to the ApsaraDB for Redis console.
  2. On the top of the page, select the region where the instance is deployed.
  3. On the Instances page, click the Instance ID of the instance.
  4. In the left-side navigation pane, click Backup and Recovery.
  5. On the Backup and Recovery page, click the Data Flashback tab.
  6. Click Enable Now to enable the data flashback feature.
    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, see AOF persistence.
    • If you only want to enable the data flashback feature, you can skip Step 7.
  7. Optional:Perform data flashback to restore data of a specific time point to a new instance.
    1. On the Data Flashback tab, click Start Flashbacking.
    2. Read the information in the dialog box and click OK.
    3. On the Clone Instance page, select one of the following billing methods.
      • Subscription: You must pay for the fees when you create an instance. We recommend that you select this billing method for long-term subscriptions because it is more cost-effective than the pay-as-you-go billing method. Higher discounts are offered for longer subscription periods.
      • Pay-as-you-go: You can pay for the instance on an hourly basis based on your actual usage. We recommend that you select this billing method for short-term subscriptions. You can release your pay-as-you-go instance to reduce costs when it is no longer required.
    4. The following table describes the parameters that you need to specify for the newly created instance.
      Configure parameters for data flashback
      Parameter Description
      Clone Source Type Select Backup Timepoint.
      Backup Timepoint Specifies a time point that is accurate to seconds, as shown in Section 5 of the preceding figure. You can specify a time point within the last seven days and restore data based on the backup file of this point of time.Backup timepoint
      Zone The zone of the cluster. Each zone is an isolated geographical area within a region. The zones that are deployed in the same region are similar.
      Network Type
      • Classic Network: a traditional network type.
      • Virtual Private Cloud (VPC): the recommended network type. A VPC is an isolated virtual network that provides higher security and better performance than a classic network.
      Notice
      • Make sure that the network type of the ApsaraDB for Redis instance is the same as that of the ECS instance. This ensures the interconnection over an internal network.
      • If the network type for both the ECS instance and the ApsaraDB for Redis instance is VPC, these two instances must be deployed in the same VPC for interconnection over an internal network.
      • You can change the network type of ApsaraDB for Redis instances from classic network to VPC. However, you cannot change the network type from VPC to classic network. For more information, see Switch to VPC.
      VSwitch A VSwitch is the basic network module that is used to build a VPC. If no VSwitch is available in the VPC, we recommend that you create a VSwitch. For more information, see Create a VSwitch.
      Edition Select Enhanced Edition (Tair). For more information, see Overview.
      Series Select Enhanced Performance. For more information, seePerformance-enhanced instances.
      Version The engine version of the ApsaraDB for Redis instance.
      Architecture Type Select Cluster or Standard based on your business requirements.
      Note Read-Write Splitting is not supported.
      • Cluster: Cluster instances use an architecture with multiple data shards. Each data shard runs in a master-replica architecture.
      • Standard: Standard master-replica instances run in a master-replica architecture to ensure high availability.
      For more information, see Overview.
      Shards The number of shards on a cluster instance.
      Node Type If Architecture Type is set to Standard or Cluster, Node Type can be set to only Master-Replica. A master-replica node runs in a two-node hot standby mode and supports data persistence.
      Instance Type Each instance type contains a group of configurations, such as the memory capacity, maximum number of connections, and maximum bandwidth. For more information, see Overview.
      Note
      • Make sure that the selected memory for the new instance is larger than the required memory for data restoration.
      • After you create an ApsaraDB for Redis instance, metadata for a database is generated. The metadata consumes a small amount of storage:
        • The metadata size for standard instances is 30 MB to 50 MB.
        • The metadata size on each shard of cluster instances is 30 MB to 50 MB. The total size of metadata for a cluster equals the sum size of metadata on each shard of the cluster.
      Set Password The password that is used to connect to the instance.
      • Now: In the Password field, enter a password.
      • Later: You can set a password after you create the instance. For more information, see Change the password.
      Instance Name The name of the clone instance.
      Duration Select a subscription duration for the instance. You can select 1 to 9 months for a monthly subscription or select 1 to 3 years for an annual subscription.
    5. Read and accept the agreement of service.
    6. In the lower-right corner of the page, click Pay or Activate, and perform the following steps to complete a payment.
    After you complete the payment, the system creates a new instance based on the backup data at the specified time point.