Lesson 1 of 3 Database Services

Running Managed Relational Databases with Amazon RDS and Aurora

This lesson explains how AWS offers managed relational databases: familiar SQL databases without the work of running database servers.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe what relational databases are suited for.
  • Describe what Amazon RDS manages and which engines it supports.
  • Describe the principal characteristics of Amazon Aurora.
  • Distinguish Multi-AZ deployments from read replicas, and a managed database from one on EC2.

Relational databases

Relational databases store data in tables of rows and columns, use SQL and enforce relationships between tables. They suit structured data and transactions, such as orders, customers and inventory.

Amazon RDS

Amazon RDS is a managed relational database service. The following list describes the engines it supports and the tasks AWS manages.

  • Runs MySQL, PostgreSQL, MariaDB, Oracle, SQL Server and Db2.
  • AWS handles hardware, setup, patching, automated backups and point-in-time recovery; you manage data, schema and access.

Two RDS features create copies of a database but serve different purposes. A Multi-AZ deployment is for high availability: RDS keeps a standby copy in another Availability Zone, updated at the same moment as the main database, and switches to it automatically if the main database fails. Read replicas are for performance: they are read-only copies, which can be in other Regions, that take read traffic, such as reports, off the main database. The following table summarises the difference.

Multi-AZ
PurposeHigh availability
HowA synchronous standby in another AZ with automatic failover
Read replicas
PurposePerformance for reads
HowRead-only copies, which can be in other Regions

The following diagram shows the primary, a standby and a read replica.

Multi-AZ deployments compared with read replicas in Amazon RDS. A Multi-AZ deployment keeps a standby copy in another Availability Zone, updated at the same moment as the primary, and fails over to it automatically, which gives high availability; the standby does not serve reads. Read replicas are read-only copies, which can be in other Regions, that take read traffic such as reports off the primary, which improves performance.
Multi-AZ for availability; read replicas for read performance.
Sort into groups

Multi-AZ or read replica?

Exam skills 3.4.2

Decide which RDS feature each statement describes.

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

Amazon Aurora

Amazon Aurora is a relational database engine built for the cloud. The following list describes its principal characteristics.

  • MySQL- and PostgreSQL-compatible database built for the cloud.
  • Up to five times the throughput of standard MySQL (three times PostgreSQL).
  • Storage grows automatically; six copies across three Availability Zones.
  • Aurora Serverless scales capacity automatically with demand.

Databases on EC2

Installing a database on EC2 gives full control, such as the exact version or configuration, but you become responsible for patching, backups, replication and high availability.

Scenario questions

Managed or self-run?

Exam skills 3.4.1

Decide between a managed database and one on EC2.

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

Making a database highly available and fast

An online shop's MySQL database runs on one RDS instance. The shop faces two problems, and RDS has a feature for each:

ProblemFeatureResult
If the database's Availability Zone fails, the shop goes offlineMulti-AZ deploymentA standby in another AZ takes over automatically in about a minute or two
Product searches slow the database down at peak timesRead replicasSearches go to read-only copies, leaving the main database for orders

Multi-AZ is for availability; read replicas are for read performance. When the shop grows further, moving to Amazon Aurora gives higher performance and storage that keeps six copies across three AZs automatically.

Check yourself

Which relational database is MySQL- and PostgreSQL-compatible and built by AWS for the cloud?

Show answer

Amazon Aurora.

Exam Tips

Remember for the exam

  • A managed relational database (MySQL, PostgreSQL, Oracle or SQL Server) is Amazon RDS.
  • High availability with automatic failover comes from RDS Multi-AZ.
  • To scale read traffic, use read replicas.
  • A cloud-native, high-performance database compatible with MySQL and PostgreSQL is Aurora.
  • Full control of the database software means running it on EC2, with more responsibility.