Creating DynamoDB Tables

Hands-On Lab

 

Photo of Fernando Medina Corey

Fernando Medina Corey

Training Architect

Length

00:30:00

Difficulty

Beginner

DynamoDB is one of the premier hosting services provided by AWS. With DynamoDB, you can spin up a NoSQL database scalable to millions of items in minutes. In this learning activity, we will deploy a DynamoDB table in which we will add some items, then also add a Local Secondary Index to this table for us to query these items using different search parameters.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Creating DynamoDB Tables

Introduction

DynamoDB is one of the premier hosting services provided by AWS. With DynamoDB, you can spin up NoSQL databases that are scalable to millions of items in just minutes.

In this hands-on lab, we will deploy a DynamoDB table, add some items to it, and add a local secondary index to the table so we can query items using different search parameters.

Log in to the AWS Management Console and the Jupyter Notebook using the credentials provided on the lab instructions page.

Create a DynamoDB Table with a Local Secondary Index

  1. In your AWS Management Console window, navigate to the DynamoDB service.
  2. Switch to your Jupyter Notebook window.
  3. Click the dynamodbBasics.ipynb file name to open it.
  4. Click into the first code cell, and press Shift + Enter to run it.
  5. Add a # to the beginning of the code cell, and press Shift + Enter to run the code again.
  6. Click into the second code cell, and press Shift + Enter to run it. (It may take a few moments to complete.)
  7. Click into the third code cell, and press Shift + Enter to run it.

Add Data to the DynamoDB Table

  1. Switch to your AWS Management Console window.
  2. On the DynamoDB page, click Tables in the left sidebar. You should see our movies table in the list.
  3. When the status of the table changes from Creating to Active, click movies to open it.
  4. Click the Items tab at the top of the menu.
  5. Switch to your Jupyter Notebook window.
  6. Click into the fourth code cell, and press Shift + Enter to run it.
  7. When it's finished running, switch to your AWS Management Console window, and click the refresh icon in the upper right of the movies table menu.
  8. Switch back to your Jupyter Notebook window.
  9. Click into the fifth code cell, and press Shift + Enter to run it. You should now see the completed table in both the AWS Management Console window and in the Jupyter Notebook.

Run Queries on the DynamoDB Table

  1. Click into the sixth code cell, and press Shift + Enter to run it. The output should return the two movies in our table that were released in 2008 whose titles begin with the letter "T".
  2. Click into the seventh code cell, and press Shift + Enter to run it. The output should return the two movies in our table that were released in 2008 and star Robert Downey Jr.

Conclusion

Congratulations, you've successfully completed this hands-on lab!