You can enable the Redis append-only file feature (AOF) for data durability. It is similar to creating manual backups. When 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, Redis goes through an AOF to replay the actions that were performed before the crash; the result is a warm Redis cache with all of the data intact.
To enable AOF for a cluster running Redis, you must create a parameter group with the appendonlyparameter set to yes, and then assign that parameter group to your cluster. Modify the appendfsync parameter to control how often Redis writes to the AOF file.
For Multi-AZ replication groups, AOF is disabled. You cannot have both features enabled.
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.
Because AOF is a file, you could run into an “Out of Disk Space” error. For greater reliability and faster recovery, AWS recommends that you create a replication group with one or more read replicas in different Availability Zones and enable Multi-AZ instead of using AOF.
AOF advantages
You can have different fsync policies: no fsync at all, fsync every second, fsync at every query.
The AOF log is an append only log, so you would not have to worry about seeks, nor corruption problems if a power outage happens.
Redis is able to automatically rewrite the AOF in background when it gets too big. The rewrite is a safe operation. While Redis continues appending to the old file, a completely new one is produced with the minimal set of operations needed to create the current data set, and once this second file is ready Redis switches the two and starts appending to the new one.
AOF contains a log of all the operations one after the other in an easy to understand and parse format.
Redis implements replication in two ways:
Redis (cluster mode disabled)
Redis (cluster mode enabled)
Each shard in a replication group has a single read/write primary node and up to 5 read-only replica nodes. Read replicas enhance read scalability and guard against data loss.
You can create up to 250 shards per Redis cluster (collection of Redis shards). The node or shard limit can be increased to a maximum of 500 per cluster if the Redis engine version is 5.0.6 or higher.
Redis Cluster mode disabled
There is a single shard (collection of Redis nodes) that contains all of the cluster’s data in each node —one primary, up to 5 secondary, read-only replica nodes. Data cannot be partitioned between nodes.
Asynchronous replication mechanisms are used to keep the read replicas synchronized with the primary.
All of the nodes in the cluster must reside in the same region, but can be spread across different AZs.
You can enable Multi-AZ with Automatic Failover for your Redis cluster with replicas.
If you have no replicas and the node fails, you experience total data loss.
Cluster mode disabled is best used for read-intensive applications or supporting large numbers of simultaneous reads from the same cluster.
Redis Cluster mode enabled
Data is partitioned across 1 up to 250 shardsor 500 per cluster if the Redis engine version is 5.6.0 or higher.
Each read replica in a shard maintains a copy of the data from the shard’s primary.
You can dynamically change the number of shards to meet needs.
Asynchronous replication mechanisms are used to keep the read replicas synchronized with the primary.
All of the nodes in a Redis (cluster mode enabled) cluster must reside in the same region, but nodes can spread across different AZs.
Multi-AZ with Automatic Failover is required for all Redis (cluster mode enabled) clusters.
If you have no replicas and a node fails, you experience loss of all data in that shard.
You cannot manually promote any of the replica nodes to primary.
Jon Bonso is the co-founder of Tutorials Dojo, an EdTech startup and an AWS Digital Training Partner that provides high-quality educational materials in the cloud computing space. He graduated from Mapúa Institute of Technology in 2007 with a bachelor's degree in Information Technology. Jon holds 10 AWS Certifications and is also an active AWS Community Builder since 2020.
AWS, Azure, and GCP Certifications are consistently among the top-paying IT certifications in the world, considering that most companies have now shifted to the cloud. Earn over $150,000 per year with an AWS, Azure, or GCP certification!
Follow us on LinkedIn, YouTube, Facebook, or join our Slack study group. More importantly, answer as many practice exams as you can to help increase your chances of passing your certification exams on your first try!
Around 95-98% of our students pass the AWS Certification exams after training with our courses.
200k+
students
Over 200k enrollees choose Tutorials Dojo in preparing for their AWS Certification exams.
~4.8
ratings
Our courses are highly rated by our enrollees from all over the world.
What our students say about us?
I’m deeply impressed by the quality of the practice tests from Tutorial Dojo. They are extremely well-written, clean and on-par with the real exam questions. Their practice tests and cheat sheets were a huge help for me to achieve 958 / 1000 — 95.8 % on my first try for the AWS Certified Solution Architect Associate exam. Perfect 10/10 material. The best $14 I’ve ever spent!
S. M. Shoaib
Khulna, Bangladesh
Given the enormous number of students and therefore the business success of Jon's courses, I was pleasantly surprised to see that Jon personally responds to many, including often the more technical questions from his students within the forums, showing that when Jon states that teaching is his true passion, he walks, not just talks the talk. I much respect and thank Jon Bonso.
Rowan Williams
Brisbane, Australia
The explanation to the questions are awesome. Lots of gap exposed in my learning. I used the practice tests along with the TD cheat sheets as my main study materials. This is a must training resource for the exam.
Using the practice exam helped me to pass. I think I wouldn't have passed if not for Jon's practice sets.
Jessica Chen
Guangzhou, China
I can say that Tutorials Dojo is a leading and prime resource when it comes to the AWS Certification Practice Tests. I also tried other courses but only Tutorials Dojo was able to give me enough knowledge of Amazon Web Services. My favorite part of this course is explaining the correct and wrong answers as it provides a deep understanding in AWS Cloud Platform. The course I purchased at Tutorials Dojo has been a weapon for me to pass the AWS Certified Solutions Architect - Associate exam and to compete in Cloud World. A Big thank you to Team Tutorials Dojo and Jon Bonso for providing the best practice test around the globe!!!
I highly recommend Jon and Tutorials Dojo!!!
Mikelito Luistro
Manila, Philippines
Did you find our content helpful?
X
NEW RELEASE - FREE AWS Certified AI Practitioner & FREE AWS Machine Learning Associate Samplers