Lesson 5 of 7 Amazon RDS and Aurora

Designing with Amazon Aurora

This lesson explains Aurora, AWS's cloud-native MySQL- and PostgreSQL-compatible database with higher performance and availability than the standard RDS engines.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe Aurora's shared storage architecture.
  • Distinguish cluster, reader, custom and instance endpoints.
  • Choose Aurora options such as Serverless v2 and Global Database.

Architecture

Amazon Aurora separates compute from storage. Its database instances share a distributed cluster volume that keeps six copies of the data across three Availability Zones. The volume tolerates the loss of two copies without affecting writes and three without affecting reads, repairs itself automatically, and grows as data is added, so no storage needs to be provisioned.

Because all instances read the same volume, Aurora supports up to 15 Aurora Replicas with replication lag of milliseconds, and when the primary fails, a replica is promoted, typically in under 30 seconds, with no data copied.

The following diagram shows the instances above the shared cluster volume.

Aurora separates compute from storage. The writer and up to 15 Aurora Replicas share one cluster volume that keeps six copies of the data, two in each of three Availability Zones. Writes survive the loss of two copies and reads the loss of three, and on failure a replica is promoted, typically in under 30 seconds, without copying data.
Because replicas read the same volume, promoting one copies no data, which is why failover is fast.

6copies

Of the data, across three Availability Zones

Fill in the value

Aurora architecture numbers

Exam skills 3.3.2

Recall the key numbers of Aurora's architecture.

Log in to try this activity Interactive activities are free with an account.

Endpoints

An Aurora cluster has one writer and up to 15 replicas sharing the same storage, and applications reach them through endpoints rather than individual instance addresses. The cluster endpoint always points to the current writer, so after a failover the application reconnects to the same name. The reader endpoint spreads connections across the replicas, so read traffic scales by adding replicas.

A custom endpoint points to a chosen subset of instances, for example larger replicas reserved for reporting queries, so heavy analytics do not slow the replicas serving the application. An instance endpoint connects to one specific instance, which is rarely needed except for diagnostics. The following table summarises the endpoints.

EndpointRoutes to
Cluster (writer)The primary
ReaderLoad-balanced across replicas
CustomA chosen subset, e.g. larger replicas for analytics so they do not slow transactions
InstanceOne specific instance

Aurora Auto Scaling adds replicas as load rises; failover priority tiers decide which replica is promoted.

The following diagram shows each kind of connection reaching the instances through an endpoint.

Aurora endpoints. The cluster endpoint always points to the current writer, the reader endpoint spreads connections across the replicas, and a custom endpoint points to a chosen subset, such as larger replicas for reporting, so analytics do not slow the replicas serving the application.
The instance sizes are illustrative. The application uses endpoint names, so failovers and new replicas need no configuration change.

15replicas

Maximum Aurora Replicas per cluster

Match the pairs

Aurora endpoints

Exam skills 3.3.2 · 3.3.1

Match each requirement with the Aurora endpoint that meets it.

Log in to try this activity Interactive activities are free with an account.

Aurora options

Aurora offers several capabilities beyond a standard cluster. Aurora Serverless v2 adjusts capacity in fine increments, measured in Aurora capacity units, as load changes, and can scale to zero when idle. It suits variable or intermittent workloads, and serverless instances can be mixed with provisioned ones in one cluster. Aurora Global Database replicates a cluster from one primary Region to read-only secondary Regions, usually within a second, which gives local reads worldwide and a cross-Region failover in about a minute; write forwarding lets secondaries accept writes and send them to the primary.

Backtrack, for Aurora MySQL, rewinds a cluster to an earlier time in place, without restoring a backup. Cloning creates a copy of a cluster in minutes that shares storage until data changes, for testing against production data. I/O-Optimized pricing suits I/O-heavy workloads, zero-ETL integration feeds data to Redshift, and parallel query speeds up analytical queries. Aurora DSQL is a separate serverless, distributed PostgreSQL-compatible database that accepts writes in several Regions at once with strong consistency. The following table summarises these options.

OptionWhat it gives
Aurora Serverless v2Instant fine-grained scaling in ACUs, can scale to zero; mix with provisioned instances; for variable or intermittent load
Aurora Global DatabaseOne primary Region, up to 10 read-only secondaries; replication typically < 1 s; cross-Region failover in about a minute; write forwarding
Backtrack (MySQL)Rewind in place without a restore
CloningFast copy-on-write copies for testing
OtherI/O-Optimized pricing, zero-ETL to Redshift, parallel query
Aurora DSQLServerless distributed PostgreSQL-compatible SQL with multi-Region active-active writes and strong consistency
Match the pairs

Aurora options

Exam skills 3.3.4 · 2.2.6

Match each requirement with the Aurora option that meets it.

Log in to try this activity Interactive activities are free with an account.
Worked example

An Aurora design for a growing application

A growing application places several demands on its database. The following table identifies the Aurora feature that meets each requirement.

RequirementAurora feature
Survive the loss of an AZ with fast failoverAurora replicas in other AZs; failover in about 30 seconds
Scale read traffic automaticallyAurora Auto Scaling of replicas behind the reader endpoint
Unpredictable load with quiet nightsAurora Serverless v2
A copy of production for testing in minutesFast database cloning
Low-latency reads and DR in another RegionAurora Global Database

The application writes through the cluster endpoint and reads through the reader endpoint, so failovers and new replicas need no configuration changes in the application.

Check yourself

Which Aurora option suits a database with unpredictable, intermittent load?

Show answer

Aurora Serverless v2, which scales capacity up and down automatically in small increments.

Exam Tips

Remember for the exam

  • For the highest availability and performance for MySQL or PostgreSQL, use Aurora.
  • For global reads and Regional disaster recovery with an RPO of about a second, use Aurora Global Database.
  • For unpredictable or intermittent workloads, use Aurora Serverless v2.
  • For a quick test copy of production use Aurora cloning; to undo a bad change quickly in Aurora MySQL use backtrack.
  • To isolate reporting queries on Aurora, use a custom endpoint with dedicated replicas.
  • To control which replica becomes the writer on failover, set failover priority tiers.