Certopolis

AWS Certified DevOps Engineer – Professional

Aurora failover and promotion tiers vs RDS Multi-AZ (DOP-C02)

Aurora keeps copies of the data across Availability Zones whatever the instance count, but fast failover needs an Aurora Replica to promote. The Aurora User Guide says a replica is promoted typically in under 60 seconds, chosen by promotion tier. An RDS Multi-AZ DB instance instead fails over to a synchronous standby that serves no reads.

What happens when an Aurora writer fails?

Aurora separates storage from compute. Data written to the primary instance is replicated synchronously to six storage nodes across Availability Zones, even if the cluster has a single DB instance. The data survives a zone failure. The DB instances are a separate matter.

If the cluster has one or more Aurora Replicas, Aurora promotes one to be the new primary. Service is typically restored in less than 60 seconds, and often less than 30. If the cluster has no replicas, Aurora recreates the primary host in the same Availability Zone, which typically takes less than 10 minutes.

If a whole zone is lost and the cluster has reader instances in other zones, Aurora fails over to one of them. If the cluster has a single instance, or all instances sit in the same zone, you must create new DB instances in another zone yourself. AWS recommends at least one replica in a different zone. The cluster endpoint always points at the current primary, so connection strings survive a failover.

How does Aurora pick the failover target?

Each Aurora Replica has a priority from 0, the highest, to 15, the lowest. Aurora promotes the replica with the highest priority. Replicas that share a priority form a promotion tier.

Within a tier, Aurora promotes the largest replica. If two replicas share both tier and size, the choice between them is arbitrary. To make the order certain, give the replicas different tiers. Changing a priority does not trigger a failover. A cluster can have up to 15 Aurora Replicas.

How is RDS Multi-AZ different?

A Multi-AZ DB instance deployment keeps one synchronous standby replica in a different zone. RDS switches to it automatically, typically in 60 to 120 seconds, and changes the DNS record of the DB instance to point at the standby. The endpoint stays the same, but existing connections must be re-established. The standby cannot serve read traffic. Rebooting the instance with failover forces a failover on demand.

A Multi-AZ DB cluster has a writer and two reader DB instances in three zones, with semisynchronous replication. The readers serve read traffic and are the failover targets. RDS promotes the reader with the most recent change record, so the instance that becomes the writer can differ each time.

Where the exam catches people

  • Believing a single-instance Aurora cluster fails over to another zone: the data is in several zones, but with no replica the host is recovered in the same zone.
  • Believing two replicas in the same tier and of the same size are promoted in a fixed order: the choice is arbitrary. Use different promotion tiers.
  • Believing tier 15 is the highest priority: 0 is the highest and 15 the lowest.
  • Believing the standby of a Multi-AZ DB instance can serve reads: it cannot. Use a Multi-AZ DB cluster or a read replica.
  • Believing a fixed reader instance stays a reader in a Multi-AZ DB cluster: either reader can be promoted, depending on which has the most recent change record.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A company runs an internal pricing service on an Amazon Aurora PostgreSQL DB cluster that has a single writer DB instance and no Aurora Replicas, to keep costs down. The cluster volume keeps copies of the data in three Availability Zones. A new operations standard requires that if the zone hosting the writer is lost, the cluster must be writable again within a few minutes without anyone creating, restoring or promoting anything. The DevOps team must meet the standard while adding as few DB instances as possible. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Resilient Cloud Solutions building.

    Not that one: A is right. In the game your Resilient Cloud Solutions building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    With one or more Aurora Replicas, Aurora detects the writer's failure and promotes a replica on its own, usually in well under a minute. With only a writer, a zone loss leaves no instance to promote, and a new one has to be created in another zone by hand. One replica in a second zone is the smallest change that makes the cluster writable again automatically.

    Written from docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.AuroraHighAvailability.html

  2. An Amazon Aurora MySQL DB cluster has its writer in us-east-1a and two Aurora Replicas of the same DB instance class: replica-b in us-east-1b and replica-c in us-east-1c. Both replicas are in promotion tier 0. Most application servers run in us-east-1b, and replica-b serves no read traffic, so its replica lag is the lowest. The DevOps team requires that when the writer fails, Aurora promotes replica-b whenever it is available and replica-c only when it is not. Both replicas must keep the same DB instance class. How should the DevOps engineer configure the cluster to meet these requirements?

    Right. In the game that’s Renown for your Resilient Cloud Solutions building.

    Not that one: C is right. In the game your Resilient Cloud Solutions building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Keeping replica-b in tier 0 and moving replica-c to tier 1 makes the order explicit: replica-b is promoted whenever it is available, and replica-c is used only if it is not. Changing a tier does not itself trigger a failover.

    Written from docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.AuroraHighAvailability.html

  3. A platform team maintains an AWS Cloud Development Kit (AWS CDK) construct that application teams use to create Amazon RDS for PostgreSQL DB instances, and each team's pipeline deploys it with its own settings. A new company standard applies to every production DB instance. Each one must keep a synchronously replicated copy in a second Availability Zone. If the host under the primary fails or its zone becomes unavailable, RDS must move the database to that copy without an operator, and the DB instance endpoint must stay the same. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Resilient Cloud Solutions building.

    Not that one: A is right. In the game your Resilient Cloud Solutions building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The failover moves the DB instance's DNS name to the standby, so applications keep the same endpoint and only need to reconnect.

    Written from docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.MultiAZSingleStandby.html

Ask for something