Aurora advanced
Aurora Serverless for variable workloads, cross-Region replicas and Aurora Global Database, Aurora machine learning, and Babelfish for SQL Server applications.
Aurora Serverless
Provisioned Aurora means choosing an instance class and paying for it every hour. For a database that is busy at some times and idle at others, that wastes money. Aurora Serverless sizes the database automatically.
- Capacity is measured in Aurora capacity units (ACUs); each ACU is about 2 GiB of memory with matching CPU and networking.
- A minimum and maximum ACU is set. Aurora adds or removes capacity in steps as small as 0.5 ACU, as the load changes, with no interruption.
- The minimum can be set to 0 ACUs: when there are no connections for a while, the instance pauses and compute costs nothing until the next connection resumes it.
- Billing is per second for the ACUs used, plus storage.
- Serverless and provisioned instances can be mixed in one cluster.
It suits infrequent, intermittent or unpredictable workloads, and removes capacity planning.
Updated since the slides
The slides show the first version, where a proxy fleet sat in front of the database. AWS has retired that version. Today's Aurora Serverless (formerly v2) scales instances in place, supports replicas, Multi-AZ and Global Database, and can scale to zero with automatic pause and resume.
Cross-Region options
Aurora cross-Region read replicas
An Aurora replica cluster can be created in another Region. Setup takes a few steps, and it's useful for disaster recovery.
Aurora Global Database
Aurora Global Database is the recommended way to run Aurora across Regions.
- One primary Region holds the cluster that takes reads and writes.
- Aurora copies data at the storage layer to up to 10 secondary Regions, using dedicated infrastructure. Replication typically takes under a second.
- Each secondary cluster can have up to 16 read replicas, so users read from a nearby Region with low latency.
- If the primary Region fails, a secondary Region is promoted to take writes. The recovery time (RTO) is under a minute.
- Write forwarding can let a secondary cluster accept writes and forward them to the primary, so apps in every Region can use a local endpoint.
AWS calls a planned move of the writer a switchover and an emergency one a failover. A global writer endpoint always points to the current primary.
Updated since the slides
Older material says up to 5 secondary Regions. The AWS documentation now says up to 10.
Aurora machine learning
Aurora machine learning calls ML models from SQL. The database sends data to an ML service and puts the predictions in the query results.
- Supported services: Amazon SageMaker AI (any trained or deployed model), Amazon Comprehend (sentiment analysis) and Amazon Bedrock (generative AI foundation models).
- No ML experience is needed: a SQL function makes the call.
- Use cases: fraud detection, ad targeting, sentiment analysis of reviews, product recommendations.
For example, an application runs SELECT asking for recommended products for a user. Aurora sends the user's profile and history to a SageMaker model and returns "red shirt, blue trousers" as rows.
Babelfish for Aurora PostgreSQL
Babelfish lets Aurora PostgreSQL understand Microsoft SQL Server's protocol and its SQL dialect, T-SQL.
- Babelfish adds a second endpoint to the cluster that speaks SQL Server's wire protocol (TDS).
- Applications built for SQL Server keep their SQL Server client driver and T-SQL code, with little or no code change.
- After the database is migrated (with AWS SCT and AWS DMS), the same apps run against Aurora PostgreSQL. SQL Server licence costs stop.
- Applications that use PostgreSQL drivers and PL/pgSQL can use the same database at the same time.
Real-world examples
- A test environment is used only in office hours. Aurora Serverless with a minimum of 0 ACUs pauses overnight and at weekends, cutting its compute bill to almost nothing.
- A global game keeps its primary database in us-east-1 and secondary Regions in Europe and Asia. Players read leaderboards locally; a Region outage is handled by promoting another Region in about a minute.
- A retailer adds a sentiment score to every product review with one SQL call to Comprehend, without building an ML pipeline.
- A company on SQL Server moves to Aurora PostgreSQL with Babelfish, keeping its .NET app and T-SQL stored procedures.
Exam tips
- "Unpredictable or intermittent workload", "no capacity planning", "pay per second" → Aurora Serverless.
- "Global application, low-latency reads in several Regions, Region-level DR with RPO of about a second and RTO under a minute" → Aurora Global Database.
- "ML predictions from SQL", "SageMaker or Comprehend from the database" → Aurora machine learning.
- "Run SQL Server applications on Aurora with few code changes" → Babelfish for Aurora PostgreSQL.
Common traps
- "Global Database secondaries accept writes like the primary." Only the primary writes (write forwarding just passes writes on to it).
- "Babelfish works with Aurora MySQL." It's for Aurora PostgreSQL only.
- "Aurora Serverless can't scale to zero." It can now, with a minimum of 0 ACUs.
Check yourself
A Global Database lab needs clusters in two Regions for long enough to replicate, which costs dollars rather than cents. Instead:
Aurora Serverless: set a minimum (or 0 ACUs with auto-pause) and a maximum; it scales up for the morning burst and down afterwards, billed per second.
Aurora Global Database with secondary Regions in Europe and Asia: local, low-latency reads, under a second of replication lag, and promotion of a secondary Region in about a minute.
AWS documentation
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.
Backups, restore and cloning
Automated backups and point-in-time restore for RDS and Aurora, manual snapshots, restoring from S3, and fast Aurora clones with copy-on-write.