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.
| Migration | Meaning | Example | Tools |
|---|---|---|---|
| Homogeneous | Same database engine | MySQL on premises → RDS for MySQL | DMS |
| Heterogeneous | Different engines; schema and code must be converted first | Oracle → Aurora PostgreSQL | AWS SCT or DMS Schema Conversion, then DMS |
SCT and DMS Schema Conversion convert tables, views and stored procedures, and report what needs manual work.
Homogeneous or heterogeneous?
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.
Benefits of managed databases
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.
| Database | Target | Type of migration | Tools |
|---|---|---|---|
| MySQL in the office | Amazon RDS for MySQL | Homogeneous (same engine) | AWS DMS |
| Oracle in the office | Amazon 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.
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.