Lab 6‐2: ‐ Getting Started with DynamoDB - Isaiah-River/SYS-360 GitHub Wiki
Navigation
Overview
In this lab, I configured a DynamoDB database, gaining some experience creating and uploading databases, uploading items to that database, creating indexes, and filtering by them.
Objectives
Completing the lab
Part 01 - Creating a DynamoDB table
I started this lab by booting up the AWS learners lab, navigating to DynamoDB, and then to "Dashboard". Here I selected "Create a table", and entered the following information:
- For the table name, enter Music.
- For the partition key, enter Artist.
- Enter SongTitle as the sort key.
- Leave Default settings selected.
I then selected "Create table", and then selected my table I just created. Here I went to "Explore table items". Then from underneath "Items returned" I selected "Create item". Here I added a new string attribute from "Add new attribute". I repeated this naming attributes "Awards", and "AlbumTitle". I then populated these fields with the following information:
- For Artist, enter
No One You Know
as the value. - For SongTitle, enter
Call Me Today
. - For AlbumTitle, enter
Somewhat Famous
. - For Awards, enter
1
.
I then selected "Create Item". I repeated this process for seven more items, making sure to make some by the same artist and the same album. I took a screenshot of my eight entries for my first deliverable:
Part 02 - Querying my table
With my table and entries created, I scrolled up to "Query" and queried for the artist "Mac Demarco". I took a screenshot for my second deliverable.
Part 03 - Create a Global Secondary Index
I moved on to creating a global secondary index. To do so, I went to "Tables" in the left-hand panel, went to my "Music" table, and went to indexes. Here I selected "Create index". Here I set the partition key to "AlbumTitle", and hit "Create Index". After a lengthy creation, I went back and queried via my new "AlbumTitle" index, taking a screenshot for my third deliverable.
Part 04 - Importing Logs and other Files into DynamoDB
For this part, I navigated to S3, and created a bucket for this lab. I then uploaded these .json files to the bucket. I then navigated back to my DynamoDB panel, where I selected the "Import from S3" feature. Here I browsed to the S3 bucket, and then uploaded the .json files, ensuring that the format was set to DynamoDB JSON, and the compression was set to none. I made sure to name the new table and to use PK as the Primary Key and SK as the Sort Key (both strings). After the table was created, I ran a query and took a screenshot for my fourth deliverable.
Part 05 - Troubleshooting Import
For this part, I just followed the validation error to CloudWatch, where I took a screenshot of the specifics that caused two files to fail to upload for my fifth deliverable.