Lesson 3 of 3 Database Services

Migrating Databases to AWS with AWS DMS

This lesson explains the tools AWS provides to move existing databases to AWS with minimal downtime, including between different database engines.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how AWS Database Migration Service (AWS DMS) migrates databases with minimal downtime.
  • Distinguish homogeneous from heterogeneous migrations and identify when AWS Schema Conversion Tool is needed.
  • Identify the benefits of managed databases.

AWS Database Migration Service (DMS)

AWS Database Migration Service moves databases to AWS with minimal disruption. The following list describes its principal characteristics.

  • Migrates databases to AWS quickly and securely.
  • The source database stays fully operational throughout.
  • Can replicate ongoing changes continuously, so the final switchover needs minimal downtime, or to feed a data warehouse.

Homogeneous versus heterogeneous migrations

A database migration is either homogeneous or heterogeneous, depending on whether the database engine changes. In a homogeneous migration, the engine stays the same, for example from MySQL on premises to RDS for MySQL, so AWS Database Migration Service (DMS) can copy the data directly. In a heterogeneous migration, the engine changes, for example from Oracle to Aurora PostgreSQL, so the database's structure and code must first be converted with the AWS Schema Conversion Tool (SCT) or DMS Schema Conversion, and then DMS copies the data. The following table summarises the two types.

MigrationMeaningExampleTools
HomogeneousSame database engineMySQL on premises → RDS for MySQLDMS
HeterogeneousDifferent engines; schema and code must be converted firstOracle → Aurora PostgreSQLAWS SCT or DMS Schema Conversion, then DMS

SCT and DMS Schema Conversion convert tables, views and stored procedures, and report what needs manual work.

Sort into groups

Homogeneous or heterogeneous?

Exam skills 3.4.5

Decide whether each migration keeps or changes the database engine.

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

Benefits of managed databases

Managed database services offer several advantages over databases that customers run themselves. They are as follows.

  • Less administration: AWS handles patching, backups and failover.
  • Better availability with Multi-AZ.
  • Easier scaling.
  • Possible licence savings by moving to open-source engines such as Aurora PostgreSQL.
Select all that apply

Benefits of managed databases

Exam skills 3.4.1

Identify the benefits of moving to a managed database service.

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

Moving two databases with little downtime

A company must migrate two on-premises databases to AWS with minimal downtime. The following table identifies the target, the type of migration and the tools required for each.

DatabaseTargetType of migrationTools
MySQL in the officeAmazon RDS for MySQLHomogeneous (same engine)AWS DMS
Oracle in the officeAmazon Aurora PostgreSQL (no Oracle licence costs)Heterogeneous (different engine)Schema conversion first (SCT or DMS Schema Conversion), then AWS DMS

In both cases DMS copies the existing data while the original database keeps serving the business, then keeps copying new changes. On cutover night the team stops the application for a few minutes, lets the last changes arrive, and points the application at the new database. Moving from Oracle to Aurora PostgreSQL also removes Oracle licence costs.

Check yourself

What is a heterogeneous database migration?

Show answer

A migration between different database engines, such as Oracle to Aurora PostgreSQL, where the schema must be converted before AWS DMS moves the data.

Exam Tips

Remember for the exam

  • To migrate a database with minimal downtime, use AWS DMS.
  • To convert schemas between different database engines, use SCT or DMS Schema Conversion.
  • The source database stays online during a DMS migration.
  • A migration that keeps the same engine is homogeneous; one that changes engine is heterogeneous.