This topic describes how to use the data flashback feature provided by ApsaraDB for Redis. This allows you to restore data to a specific point in time. During the retention period of backup files, the data flashback feature provides a solution to restore data to a specific point in time. This feature is applicable to scenarios where you want to frequently restore data. It also allows you to avoid data loss caused by user errors.

Prerequisites

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 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 point in time that is accurate to the second. This allows you to restore data at an accurate time point.

Limits

  • You can restore data only to a specific point in time during the period from the time when the data flashback feature 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, migration across zones, or minor version upgrades. For example, if you change the configurations of an instance, the point in time that you can restore data starts from the time when the configuration change is complete.
  • After you enable the data flashback feature, it requires about 10 minutes for the system to upload data and logs.

Pricing

Operation Description
Enable the data flashback feature Free of charge.
Perform data flashback
  • 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 the point in time of restoration. For more information, see this topic or the announcement on the Alibaba Cloud website.
  • The system creates an instance and restores the data to the instance. You must 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 Instance List 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 want to enable only the data flashback feature, you can skip Step 7.
  7. Optional:Perform data flashback to restore data of a specific point in time to a new instance.
    1. On the Data Flashback tab, click Enable Now.
    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 an instance when you create the instance. We recommend that you select this billing method for long-term use 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 must pay for the instance on an hourly basis based on your actual usage. We recommend that you select this billing method for short-term use. 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 set for the newly created instance.
      Configure parameters for data flashback
      Parameter Description
      Clone Source Type Select Backup Timepoint.
      Backup Timepoint Specifies a point in time that is accurate to the second. You can specify a point in time within the last seven days and restore data based on the backup file of this point in time.Backup timepoint
      Zone The zone of the cluster. Each zone is an isolated geographical area within a region. The zones whinin the same region are similar.
      Network Type
      • Classic Network: a traditional network type.
      • VPC: the recommended network type. A VPC network 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 switch the network type of an ApsaraDB for Redis instance from classic network to VPC, but cannot switch from VPC to classic network. For more information, see Switch to VPC network.
      VSwitch A vSwitch is the basic network module that is used to build a VPC. If no vSwitch is available in the VPC, you must 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, see Performance-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 capacity for the new instance is larger than the required memory for restoring data.
      • 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 of 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 of a cluster instance equals the sum of metadata on each shard of the cluster instance.
      Set Password The password that is used to connect to the instance.
      • Now: In the Password field, enter a password.
      • Later: Set the password after the instance is created. For more information, see Change or reset the password.
      Instance Name The name of the new instance.
      Duration Select a subscription duration for the instance. You can select one to nine months for a monthly subscription or select one to three 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 the payment.
    After you complete the payment, the system creates a new instance based on the backup data at the specified point in time.