By default, append-only file (AOF) persistence is enabled for Tair. This topic describes how to enable or disable AOF persistence by setting the appendonly parameter.

Overview

Tair provides two data persistence options: AOF persistence and Redis Database (RDB) persistence. AOF persistence logs every write operation received by the server, such as SET. When you restart a Tair instance, the system reruns the commands in the AOFs to restore data. If an AOF is too large, Tair runs an AOF rewrite task to recreate the AOF at a reduced file size.

You can specify the AOF_FSYNC_EVERYSEC policy to enable AOF persistence for Tair 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 impact on the performance and can minimize data loss caused by accidental operations. Tair allows you to archive incremental backups based on AOFs and ensures service performance when the system runs the AOF rewrite task.

AOF persistence may affect write performance. If a Tair instance is used in a cache-only scenario, you can perform the operations described in this topic to set the appendonly parameter to disable AOF persistence for the instance.

Status and impacts of AOF persistence

  • By default, when you create a Tair instance, AOF persistence is enabled for the instance.
  • If you set the appendonly parameter to no, the following impacts exist:
    • The system disables AOF persistence without the need to restart the instance.
    • After AOF persistence is disabled, AOFs cannot be used to restore data.
    • The existing AOF logs remain unaffected.
    • For a standard instance, AOF persistence is disabled for the master node and the replica node is not affected.
    • For a cluster instance, AOF persistence is disabled for the master nodes of all data shards and the replica nodes are not affected.
    • For a read/write splitting instance, AOF persistence is disabled for the master node and all read replicas and the replica node is not affected.
  • If you change the appendonly value to yes, the system enables AOF persistence without the need to restart the instance.

Procedure

  1. Log on to the Tair 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.
  2. In the left-side navigation pane, click System Parameters.
  3. On the System Parameters page, click Modify in the Actions column corresponding to the appendonly parameter.
  4. In the dialog box that appears, perform the following steps:
    1. Set the appendonly parameter.
      Valid values:
      • yes: enables AOF persistence.
      • no: disables AOF persistence.
    2. Click OK.

Related API operations

OperationDescription
DescribeParametersQueries the configuration and operational parameters of a Tair instance.
ModifyInstanceConfigModifies parameters of a Tair instance.