- Lab
- A Cloud Guru

Migrating from a Relational Database to DynamoDB
In this lab, we will work through the process of migrating a normalized relational database to an Amazon DynamoDB table and test to ensure our data was migrated successfully.

Path Info
Table of Contents
-
Challenge
Investigate the Source Database
Log in to the provided bastion host:
ssh cloud_user@<BASTION_PUBLIC_IP>
Then, connect to the source database:
mysql -h <SOURCE_DATABASE_PUBLIC_IP> -u cloud_user -pbettertogether employees
Note: There's no space between the
-p
parameter and the passwordbettertogether
. -
Challenge
Design a Data Model and DMS Task Mapping Rules
With the information gathered from the source database, design your data model with consideration for the provided access patterns. Map this data model to the DynamoDB table partition/sort keys, as well as any local or global secondary indexes. Then, create DMS task mapping rules to map the data from the source database to your DynamoDB table.
References
- The data model shown in our solution video is available at this link
- DMS Task Mapping Rule Reference
-
Challenge
Create a DynamoDB Table
Navigate to the DynamoDB web console and create a DynamoDB table called
employees
. Additionally, you will need to create three local secondary indexes calledFullname
,hire_date
, andtitle_from_date
, as well as a global secondary index with a partition name oftitle
and a sort key ofsalary_to_date
. -
Challenge
Create and Start a DMS Task
Navigate to the Database Migration Service web console and create a new task using the mapping rules you created, and set the task to start automatically.
-
Challenge
Test Access Patterns
Once the DMS task has completed, navigate to the DynamoDB web console and test that you have satisfied the requested access patterns.
You will need to satisfy the following access patterns:
- Search the table for all employees in the Development department with the title Senior Engineer and only include their most recent salary.
- Get all information about an employee in the Production department with the
Fullname
Hercules Benzmuller. - Get information on all employees in the Production department hired between January 1, 1999 and January 1, 2001. Filter this data so there are no duplicate records.
- Get information on all employees in the Development department that had a title change in the 6 months before January 1, 2001. Filter this data so there are no duplicate records.
- Get information on all employees with the title Engineer and return only records that show their most recent salary date.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.

