Lab 6 2: Getting Started with DynamoDB - nicolas-tullio/Tech-Journal GitHub Wiki

Deliverables

Screenshot of 8 entries in table

image

Screenshot of successful query

image

Screenshot of successful query of AlbumTitle index)

image

Screenshot of successful query of new table

image

Screenshot: Showing the specifics of why the 2 items failed import

image

Steps

Create a Table

Navigate to DynamoDB > Dashboard

image

Choose Create Table

image

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.

image

Choose create table

image

Write Data to the Table

Select the Music table

image

Select Explore Table Items

image

In the Items view, choose Create item

image

Choose Add new attribute, and then choose Number. Name the field Awards

Repeat this process to create an AlbumTitle of type String

image

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.

image

Choose Create item

image

Create 7 more items and include the AlbumTitle and Awards Attiributes

image

Query Data

Navigate to Tables > Music > Explore items

Choose Query

image

For Partition key, enter "a band in your table", and then choose Run.

image

Create a Global Secondary Index

Navigate to Tables > Music > Indexes

image

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)

image

Importing Logs and other Files into DynamoDB

Create a new S3 bucket with a name for this lab

image

Upload the .json files in this zip file to your new S3 Bucket: DynamoDB_S3_Import_SampleData.zip https://champlain.instructure.com/courses/2216686/files/297067037?wrap=1

image

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

image

image

image

  • It make take a bit to create - and you will get some validation errors

Once the table is active, run a query

image

Troubleshooting Import

Follow the Validation Error in DynamoDB to get to the error logs in CloudWatch

image

image

Clean Up

Once you have all your screenshots - delete your 2 Tables from DynamoDB - and your S3 Bucket

image

image

image