Amazon Aurora
How Aurora separates compute from a shared six-copy storage volume, its endpoints, replicas and auto scaling, custom endpoints, and its main features.
What it is
Amazon Aurora is a relational database engine built by AWS for the cloud. It is compatible with MySQL and PostgreSQL: existing drivers and SQL work as if Aurora were MySQL or PostgreSQL. It isn't open source.
Aurora keeps the database engine but rebuilds the storage underneath it. Compute (the DB instances) and storage (one shared cluster volume) are separate, which gives:
- more performance: AWS claims up to 5× MySQL and 3× PostgreSQL on RDS;
- storage that grows by itself, up to 128 TiB, or 256 TiB on newer engine versions, billed only for what's used;
- up to 15 replicas with very little lag (usually under 100 ms);
- near-instant failover, typically under 30 seconds.
It costs about 20% more per instance than RDS, but often does more work per dollar.
How it works
An Aurora DB cluster has:
- One writer (primary) instance that takes all writes.
- Up to 15 Aurora Replicas that serve reads, in any AZ.
- One cluster volume shared by all of them. It keeps six copies of the data, two in each of three AZs.
The storage is designed to keep working through failures:
- A write succeeds when 4 of the 6 copies have it; a read needs 3 of 6. So Aurora keeps writing even if a whole AZ is lost.
- Storage is split into small pieces striped across hundreds of volumes, and it repairs itself: a damaged copy is rebuilt from its peers.
- Because the replicas read the same volume as the writer, there is no copying of data to each replica, which is why replica lag is so low.
If the writer fails, Aurora promotes a replica to be the new writer automatically, usually in under 30 seconds. Aurora also supports cross-Region replication (see Global Database).
Endpoints
Instances come and go (failover, auto scaling), so applications connect to endpoints, DNS names that follow the right instances:
- Cluster (writer) endpoint: always points to the current writer. Use it for writes. After a failover it points to the new writer, with no app change.
- Reader endpoint: balances connections across all the replicas. Use it for read-only queries.
- Custom endpoints: a chosen set of instances. For example, run analytics queries on two bigger replicas so they don't slow the replicas serving the website. Once custom endpoints are defined, the general reader endpoint usually stops being used.
- Instance endpoints: one specific instance, for troubleshooting.
The reader endpoint balances at the connection level, not per query.
Replica auto scaling
Aurora Replica auto scaling adds or removes replicas to keep a metric near a target, using Application Auto Scaling. For example: keep average replica CPU at 60%, or a target number of connections. When many reads arrive, CPU rises, Aurora adds replicas, and the reader endpoint starts sending connections to them.
More features
- Automatic failover and automated backups with point-in-time recovery (see backups).
- Isolation and security: VPC, encryption with KMS, IAM authentication (see security).
- Industry compliance, push-button scaling, advanced monitoring and routine maintenance, as with RDS. Most patching happens with little or no downtime.
- Backtrack (Aurora MySQL): rewind the cluster to a point in time without restoring a backup, up to 72 hours back.
Limits and pricing
- Instances are billed per hour (or as Aurora Serverless capacity); storage per GB-month of what's used; plus I/O requests, unless the Aurora I/O-Optimized configuration is chosen, which has no I/O charges and higher instance and storage prices.
- 15 replicas per cluster. Cluster volume up to 128 TiB, or 256 TiB on newer versions (Aurora MySQL 3.10 and later, recent Aurora PostgreSQL 15, 16 and 17 versions).
Updated since the slides
The slides give the maximum as 128 TB in one place and 256 TB in another. The AWS documentation says 256 TiB on newer engine versions and 128 TiB on older ones. Remember "it grows automatically to a very large size"; the exact number matters less.
Real-world examples
- A SaaS company moves from RDS MySQL to Aurora MySQL: the same code runs, failover drops from minutes to seconds, and reporting runs on a custom endpoint.
- A ticketing site sets replica auto scaling on CPU. When tickets go on sale, Aurora adds replicas in minutes and removes them afterwards.
- A developer runs a bad
DELETEon Aurora MySQL. Backtrack rewinds the cluster to five minutes earlier, without a restore.
Compared with RDS
| RDS | Aurora | |
|---|---|---|
| Storage | Sized manually | Grows itself |
| Replicas | Own copies | Share storage |
| Failover | 1–2 minutes | Under 30 s |
Exam tips
- "MySQL or PostgreSQL compatible, high performance, high availability, minimal management" → Aurora.
- "Six copies across three AZs", "self-healing storage" → Aurora.
- "Send read traffic to replicas automatically" → reader endpoint. "Analytics on specific bigger replicas" → custom endpoint.
- "Replicas scale with read load" → Aurora Replica auto scaling.
- "Undo a mistake quickly without restoring a backup" → Backtrack (Aurora MySQL).
Common traps
- "Aurora supports Oracle or SQL Server." Only MySQL- and PostgreSQL-compatible (for SQL Server apps, see Babelfish).
- "You must size Aurora storage in advance." It grows automatically.
- "Point the app at one replica's instance endpoint for reads." Use the reader or custom endpoint, which survive replica changes.
Hands-on lab: an Aurora cluster and its endpoints
Goal: create a small Aurora PostgreSQL cluster with a writer and a replica, and see the writer and reader endpoints.
Costs money
Two db.t4g.medium instances cost about $0.15 an hour in us-east-1, plus a few cents of storage and I/O. Delete the cluster within the hour. Any Region works.
Create the cluster
RDS → Create database → Standard create → Aurora (PostgreSQL Compatible). Template Dev/Test. Cluster identifier saa-aurora, master username postgres, self-managed password. Instance configuration Burstable classes, db.t4g.medium. Availability: Create an Aurora Replica or Reader node in a different AZ. Connectivity: Connect to an EC2 compute resource → saa-web. Tag Project=saa-lab, create.
Look at the endpoints
Open saa-aurora. On Connectivity & security you see a Writer endpoint (saa-aurora.cluster-…) and a Reader endpoint (saa-aurora.cluster-ro-…). The two instances below have the roles Writer instance and Reader instance.
Fail over
Select the writer instance → Actions → Failover. Within about 30 seconds the roles swap. The writer endpoint name hasn't changed, but it now points to the other instance.
Expected result: a cluster whose endpoints follow the roles, so applications never need to know which instance is the writer.
Clean up: delete the reader instance, then the writer instance; when you delete the last instance RDS offers to delete the cluster (no final snapshot, don't retain backups). Delete the rds-ec2-* and ec2-rds-* security groups.
AWS documentation
Read replicas and Multi-AZ
Read replicas for read scaling, their network cost, Multi-AZ standbys for failover, Multi-AZ DB clusters, moving from Single-AZ to Multi-AZ, and RDS Custom.
Aurora advanced
Aurora Serverless for variable workloads, cross-Region replicas and Aurora Global Database, Aurora machine learning, and Babelfish for SQL Server applications.