AWS Solutions Architect Associate Certification
Services Migration and Transfer
Database Migration Service
In this lesson, we explore the AWS Database Migration Service (DMS), a managed solution designed to help you quickly and securely migrate databases and analytics workloads to AWS with minimal downtime and zero data loss. DMS is to databases what Application Migration Service is to servers and applications – offering specialized tools that streamline the migration process. This service is ideal for moving databases from on-premises environments to the cloud, supporting over 20 different database and analytics platforms including MySQL, PostgreSQL, and more.
Key Components of DMS
DMS Fleet Advisor
The DMS Fleet Advisor gathers data from multiple database environments to provide comprehensive insights into your data infrastructure. It supports popular databases such as Microsoft SQL Server, MySQL, Oracle, and PostgreSQL. A data collector is installed on your database server (for example, a MySQL on-premises server) and captures essential information, which is then reported to DMS. This data can be exported for further analysis.
This process is similar to the discovery phase in other migration services, where an agent collects environment data to help you assess migration requirements.
DMS Schema Conversion Tool
The DMS Schema Conversion Tool is specifically designed to simplify migrations between different database types. It evaluates the complexity of the migration and converts database schemas along with associated code objects. For example, when switching from MySQL to PostgreSQL, the tool addresses subtle differences in schema definitions between the two systems.
Note
The Schema Conversion Tool is particularly beneficial when migrating between systems with differing SQL dialects, ensuring that your target environment is correctly configured.
Replication Instance
During the migration process, the replication instance continuously transfers data from your on-premises source to the AWS target environment. This ensures that the target always mirrors the most current data. AWS DMS connects to your data stores via endpoints, which function as access points for both the source and the target databases. When configuring these endpoints, details such as endpoint type (source or target), database engine (e.g., Oracle or MySQL), server address, port number, encryption options, and credentials must be specified to guarantee secure connectivity.
After defining the endpoints, you create a replication task by selecting the replication instance and specifying the source (on-premises) and target (AWS) endpoints. This task then manages the migration process seamlessly.
Migration Types
DMS supports several migration strategies to suit different use cases:
- Full Load: Migrates all current data from the source to the target database while creating necessary tables. This method is suitable if you can allocate a brief period of downtime.
- Full Load plus CDC (Change Data Capture): Performs a complete initial data load and then captures any ongoing changes in the source database. This ensures that after the initial migration, the target database is continuously updated until final cutover.
- CDC Only: When a bulk initial load is handled by another method, DMS can be used solely for capturing and applying ongoing changes during the migration process, particularly in homogeneous environments using native tools.
Continuous Data Replication and Schema Conversion
One of the key strengths of AWS DMS is its ability to maintain continuous data replication between the source and target databases, keeping both environments in sync throughout the migration period.
Additionally, AWS DMS provides automatic schema conversion. This feature adapts the source database schema to match the target. For example, it can map an Oracle VARCHAR2 data type to a PostgreSQL VARCHAR or convert schemas from various data warehouse formats to Amazon Redshift.
Endpoints and Tasks
Endpoints in AWS DMS represent source and target databases. For instance, an on-premises Oracle database serves as a source endpoint, while an Amazon Aurora database in the cloud serves as a destination endpoint. A migration task defines how data moves from the source to the target. These tasks can be started, stopped, paused, updated, and monitored to ensure real-time progress and receive actionable alerts.
Warning
Ensure that all endpoint configurations, including encryption and credential settings, are correct before initiating the migration to prevent potential data loss or security issues.
Use Cases of Database Migration Service
AWS Database Migration Service is a versatile tool that can be used in several scenarios:
Use Case | Description | Example |
---|---|---|
Data Migration | Transfer databases from legacy systems or on-premises environments to AWS-managed cloud environments. | Migrating an on-premise Oracle database to Amazon Aurora. |
Change Data Capture | Continuously replicate and apply data changes between source and target databases in real time. | Syncing a MySQL source with a PostgreSQL target. |
Integration with Data Lakes | Facilitate the construction of data lakes and enable real-time processing of changes from various data stores. | Ingesting and processing data for analytics on AWS. |
By leveraging its robust set of features, AWS DMS provides a seamless and efficient database migration experience with minimal disruption to your operations.
For more information on database migration and other AWS services, explore the AWS Documentation.
Watch Video
Watch video content