By default, append-only file (AOF) persistence is enabled for ApsaraDB for Redis. This topic describes how to set the appendonly parameter to enable or disable AOF persistence.
Overview
ApsaraDB for Redis 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. After you restart ApsaraDB for Redis, the service runs the operations logged in the AOF files to restore data. If the files become too big, ApsaraDB for Redis can rewrite the files to optimize storage usage in the background.
AOF persistence follows the AOF_FSYNC_EVERYSEC policy of fsync every second write performances. The system records the received write commands to AOF every second. The policy has the least effect on the performance and can minimize data loss caused by user errors or a power outage. ApsaraDB for Redis can archive incremental AOF files to ensure service performance when ApsaraDB for Redis rewrites the logs.
AOF persistence may affect the write performance. If an ApsaraDB for Redis instance is used in a cache-only scenario, you can perform the operations in this topic to set the appendonly parameter to disable AOF persistence for the instance.
Status and impacts of AOF persistence
- By default, AOF is enabled for an ApsaraDB for Redis instance.
- If you set the value of appendonly to no:
- The system disables AOF persistence without restarting the instance.
- After AOF persistence is disabled, the AOF files cannot be used to restore the data.
- The existing AOF logs remain unchanged.
- For a standard instance, AOF persistence is disabled for the master. The replica is not affected.
- For a cluster instance, AOF persistence is disabled for the master nodes of all data shards. The replica nodes are not affected.
- For a read/write splitting instance, AOF persistence is disabled for the master node and all read replicas. The replica node is not affected.
- If you change the value of appendonly to yes: The system enables AOF persistence without restarting the instance.
Disable AOF persistence in the console
Related operations
Operation | Description |
---|---|
DescribeParameters | Queries the configuration and operational parameters of an ApsaraDB for Redis instance. |
ModifyInstanceConfig | Modifies parameters of an ApsaraDB for Redis instance. |