Ends in
00
days
00
hrs
00
mins
00
secs
LEARN MORE

SALE! AWS Specialty Practice Exams at $15.99 USD each ONLY instead of $17.99

Redis Append-Only Files vs Redis Replication

Redis Append-Only Files (AOF)

Redis Replication

  • 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 appendonly parameter 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 shards or 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.

Note: If you are studying for the AWS Certified Database Specialty exam, we highly recommend that you take our AWS Certified Database – Specialty Practice Exams and read our Database Specialty exam study guide.

AWS Certified Database Specialty Practice Exams

Sources:
https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/RedisAOF.html
https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Replication.Redis.Groups.html
https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Replication.Redis-RedisCluster.html
https://redis.io/topics/persistence

AWS Specialty Practice Exams SALE!

NEW! AWS Certified Developer Associate Video Course (Early Access Release)

NEW! AWS Certified Solutions Architect Associate Video Course [Early Access Release]

IT Certification Category (English)728x90

Pass your AWS, Azure, and Google Cloud Certifications with the Tutorials Dojo Portal

Tutorials Dojo portal

Our Bestselling AWS Certified Solutions Architect Associate Practice Exams

AWS Certified Solutions Architect Associate Practice Exams

Enroll Now – Our AWS Practice Exams with 95% Passing Rate

AWS Practice Exams Tutorials Dojo

FREE AWS Cloud Practitioner Essentials Course!

Enroll Now – Our Azure Certification Exam Reviewers

azure reviewers tutorials dojo

Enroll Now – Our Google Cloud Certification Exam Reviewers

Tutorials Dojo Exam Study Guide eBooks

tutorials dojo study guide eBook

Subscribe to our YouTube Channel

Tutorials Dojo YouTube Channel

FREE Intro to Cloud Computing for Beginners

FREE AWS, Azure, GCP Practice Test Samplers

Browse Other Courses

Generic Category (English)300x250

Recent Posts

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!

View Our AWS, Azure, and GCP Exam Reviewers

Our Community

~98%
passing rate
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?

error: Content is protected !!