Redis Append Only Files (AOF)
By default, the data in a Redis node on ElastiCache resides only in memory, and is not persistent. If a node is rebooted, or if the underlying physical server experiences a hardware failure, the data in the cache is lost.
If you require data durability, you can enable the Redis append-only file feature (AOF). When this feature is enabled, the node writes all of the commands that change cache data to an append-only file. When a node is rebooted and the cache engine starts, the AOF is "replayed"; the result is a warm Redis cache with all of the data intact.
AOF is disabled by default.
To enable AOF for a cluster running Redis,
you must create a parameter group with the
appendonly parameter set to yes,
and then assign that parameter group to your cluster.
You can also modify the
appendfsync parameter to control how often Redis writes to the AOF file.
Append-only files (AOF) are not supported for cache.t1.micro and cache.t2.* nodes.
For nodes of these types, the
appendonly parameter value is ignored.
For Multi-AZ replication groups, AOF is disabled.
AOF is not supported on Redis versions 2.8.22 and later.
AOF cannot protect against all failure scenarios. For example, if a node fails due to a hardware fault in an underlying physical server, ElastiCache will provision a new node on a different server. In this case, the AOF file will no longer be available and cannot be used to recover the data. Thus, Redis will restart with a cold cache.
For greater reliability and faster recovery, we recommend that you create one or more read replicas in different availability zones for your cluster, and enable Multi-AZ on the replication group instead of using AOF. AOF is disabled for Multi-AZ replication groups.
For more information on mitigating failures, see Mitigating Failures when Running Redis.
For more information see: