An Introduction to AWS Database Migration
AWS Database Migration Service, or AWS DMS, is a cloud services offering that migrates relational, NoSQL, and several other types of databases. With AWS DMS, customers have the option to fully migrate their data to the cloud or utilize a combination of cloud and on-premises setups.
With AWS DMS not only can you initially migrate the databases, but you can also replicate the ongoing changes. For migrating a different database engine, we can use the AWS Schema Conversion Tool (AWS SCT) to convert the database schema to the new platform then utilize AWS DMS to migrate the data.
At the basic level, AWS DMS is a sever in the AWS Cloud that runs replication software. We create a source and target database connection to tell AWS DMS where to extract form and load to with the help of a replication instance. After that we schedule a task that runs on this sever to move the data from the source to the target database.
The following diagram illustrates the AWS DMS replication process.
Benefits of AWS Database Migration
- AWS DMS can deploy, manage, and monitor all hardware and software needed for migration automatically so you can avoid conventional tasks like capacity analysis, procurement of hardware and software, system installation and administration and testing/debugging of systems.
- AWS DMS allows us to scale migration resources up or down as per requirements.
- With AWS DMS we only pay for resources that we use since it has a pay-as-you-go model unlike traditional licensing plans with up-front purchase costs and ongoing maintenance fees.
- Another benefit of AWS DMS is automatic failover. A backup replication is used as if the main replication server fails.
- Almost all DBMS engines like Oracle, Microsoft SQL Server, MySQL, MariaDB, PostgreSQL, Db2 LUW, SAP, MongoDB, and Amazon Aurora are supported by AWS DMS.
- AWS DMS enables heterogenous data migration with the help of AWS schema conversion tool.
- AWS DMS migrates data with security. Data at rest is encrypted with AWS Key Management Service (AWS KMS) encryption.
Components of AWS DMS
AWS DMS migrations consist of three components:
- Replication instance
- Source and target endpoints
- Replication task
Replication Instance:
A replication instance is simply a managed Amazon Elastic Compute Cloud (Amazon EC2) instance that hosts one or more replication tasks. AWS DMS provides high availability and failover support using a multi availability zone deployment. It will automatically create standby replica of the replication instance in different availability zones.
Below is an example of creating a replication instance:
- By providing the replication instance’s name, VPC, and security group name and making it publicly accessible, we can create the replication instance.
Endpoint:
An endpoint is an access point (URL) of a database through which we can access the source and target database. AWS DMS uses endpoints to connect the source and target databases.
To create an endpoint, some information is required:
- Endpoint type: source or target.
- Engine type: type of database engine such as MariaDB, Oracle, etc.
- Server name: sever name or IP address of database server.
- Port no: Port number of database server.
- Credentials: username and password from which we can access the databases.
Avoid Contact Center Outages: Plan Your Upgrade to Amazon Connect
Learn the six most common pitfalls when upgrading your contact center, and how Amazon Connect can help you avoid them.
Before creating a replication task, you should test it.
Below is an example of creating an endpoint in AWS DMS:
Replication Tasks:
Replication tasks are helpful to move a set of data from a source endpoint to a target endpoint.
To create a replication task the follow is required:
- Replication instance
- Source endpoint
- Target endpoint
- Migration type option:
- Full load (migrating exisiting data from database): This will help to only migrate exisiting databases from the source to the target database.
- Full load and CDC (change data capture): This is applicable for migrating full data loads and capturing ongoing changes in a source and reflect it onto the target database.
- CDC only: This is helpful only for migrating ongoing changes in data.
Schema and Code Migration
When it comes to converting schema in heterogenous database migrations, you will want to utilize a tool known as AWS SCT (schema conversion tool), which will aid you in coverting you schema of a source database to the intended target database.
The below figure shows an example of this replication task:
Source Database for AWS DMS
Source database is the database from where data is migrated through AWS DMS. It may be in on-premises or in an AWS platform (AWS S3, AWS RDS instance).
AWS DMS supports the following databases:
- Microsoft SQL
- MariaDB
- PostgreSQL
- MongoDB
- AWS S3
- Amazon Aurora
- Amazon Document DB
- and several others
below is an example of a MariaDB database on an AWS EC2 instance as source database:
Target Database for AWS DMS
Target database is the destination point on which data is to be migrated. AWS DMS supports the following databases:
- MySQL
- MariaDB
- Oracle
- PostgreSQL
- Amazon RDS instance database
- Amazon Redshift
- Amazon DynamoDB
- Amazon s3
- Amazon kinesis data stream
- Amazon Neptune
- Amazon Kafka, etc.
Below is an example of using MariaDB database on a RDS instance as the target database:
Once the data has been migrated, we can check on the target database server using a SQL command.
Limitations of AWS DMS
- For heterogenous database migrations AWS DMS is unable to convert the schema of the source database. We must use a third party tool like AWS SCT.
- Note: AWS SCT is unable to convert schema of Oracle databases.
- AWS DMS requires a bit of code for changes on data capture for incremental codes.
- Maintaining AWS DMS on an ongoing basis can be challenging at a time.
- With large database migration AWS DMS may slow down the source database.
How can Perficient help you?
Perficient is a certified Amazon Web Services Partner with more than 10 years of experience delivering enterprise-level applications and expertise in cloud platform solutions, contact center, application modernization, migrations, data analytics, mobile, developer and management tools, IoT, serverless, security, and more. Paired with our industry-leading strategy and team, Perficient is equipped to help enterprises tackle the toughest challenges and get the most out of their implementations and integrations.
Learn more about our AWS practice and get in touch with our team here!
Very well written, Thank You !!
great work ..! Very helpful
Great work. This will help surely !
Nice Blog Arjun, Keep up the good work!!
An immensely informative article!!👌
Many, many congratulations, Arjun, for this gem of an informative blog-post!! 😊😊👍👍💐💐
Looking forward to reading many more such articles from you in future!
All the best!