About AOF persistence

This page provides an overview of Append Only File (AOF) persistence for Memorystore for Redis Cluster.

Memorystore for Redis Cluster also supports Redis Database (RDB) persistence, but you must choose either the AOF or the RDB persistence mode, because you can't enable both persistence modes at the same time. For more information about choosing between the two modes, see Persistence overview.

To ensure that your cluster remains resilient during maintenance or unexpected failures, we recommend that in addition to enabling AOF persistence for the cluster, you use a highly available cluster.

To learn how to enable, disable, and monitor AOF persistence, see Manage persistence.

AOF persistence overview

The AOF persistence mode prioritizes data durability. It durably stores data by recording every write command to a log file called the AOF file. If a system failure or restart occurs, the server replays AOF file commands sequentially to restore your data. Unlike RDB persistence, AOF persistence can't be paused.

If you enable or disable AOF persistence for a cluster, then you might need to perform maintenance on the cluster.

Sync setting

The sync setting (appendfsync) for the AOF persistence mode determines how often the cached data in memory is saved to durable storage. We recommend keeping the sync setting at 1 second, which is the default. Syncing every second provides the best compromise between the cluster's performance and the durability of the data.

Before the AOF logs are saved to durable storage, they are stored in memory by the operating system, and if a system failure or restart occurs during this time, the writes in memory can be lost. The sync setting lets you choose how often data is saved to durable storage, and provides the following options:

  • always - This option saves data to storage for every write.
  • everysec - This option saves data to storage every second.
  • no - This option relies on the operating system to flush data to storage on its own schedule, which typically happens every 30 seconds.

Choosing to sync for every write provides the best data durability, however this comes with a performance tradeoff. We recommend syncing every second, which provides both good data durability and performance.