Lab 6 2: Getting Started with DynamoDB - nicolas-tullio/Tech-Journal GitHub Wiki
Deliverables
Screenshot of 8 entries in table
Screenshot of successful query
Screenshot of successful query of AlbumTitle index)
Screenshot of successful query of new table
Screenshot: Showing the specifics of why the 2 items failed import
Steps
Create a Table
Navigate to DynamoDB > Dashboard
Choose Create Table
Enter the table details as follows:
-
For the table name, enter Music.
-
For the partition key, enter Artist.
-
Enter SongTitle as the sort key.
-
Leave Default settings selected.
Choose create table
Write Data to the Table
Select the Music table
Select Explore Table Items
In the Items view, choose Create item
Choose Add new attribute, and then choose Number. Name the field Awards
Repeat this process to create an AlbumTitle of type String
Enter the following values for your item:
-
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
.
Choose Create item
Create 7 more items and include the AlbumTitle and Awards Attiributes
Query Data
Navigate to Tables > Music > Explore items
Choose Query
For Partition key, enter "a band in your table", and then choose Run.
Create a Global Secondary Index
Navigate to Tables > Music > Indexes
Choose Create index:
-
For the Partition key, enter
AlbumTitle
-
For Index name, enter
AlbumTitle-index
-
Leave the other settings on their default values and choose Create index
Once Active - you can query using that Index
*NOTE: Took a long time be patient
Perform a query using that index (AlbumTitle)
Importing Logs and other Files into DynamoDB
Create a new S3 bucket with a name for this lab
https://champlain.instructure.com/courses/2216686/files/297067037?wrap=1
Upload the .json files in this zip file to your new S3 Bucket: DynamoDB_S3_Import_SampleData.zip From DynamoDB - use the Import from S3 feature
- Can browse to the bucket - should be able to select the bucket to import all files
- Format is DynamoDB JSON and compression is NONE
- Name the new table
- Use PK as the Primary Key and SK as the Sort Key (both strings)
- Accept defaults
- It make take a bit to create - and you will get some validation errors
Once the table is active, run a query
Troubleshooting Import
Follow the Validation Error in DynamoDB to get to the error logs in CloudWatch
Clean Up
Once you have all your screenshots - delete your 2 Tables from DynamoDB - and your S3 Bucket