In this lab, we will explore DynamoDB Local and Global secondary indexes, and their impact on performance and capacity unit usage.
An existing unindexed table is provided, and we will create a new table with Local and Global secondary indexes. Load the same dataset into our new table with a provided data loader, then use a test utility to observe the performance and capacity differences when performing read operations against tables with and without indexes.
**Note: Use the `us-east-1` region for this lab.**
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create a New Table with Local and Global Secondary Indexes
- Log in to the AWS Web Console for the lab environment at the provided URL with the supplied credentials.
Note: Use theus-east-1 region
for this lab. - Create a new DynamoDB Table named
album_indexed
with a Partition Key ofartist_id
and a Sort Key ofid
. Add a Local secondary index for theformat
attribute, and create a Global secondary index for thetitle
attribute.
- Log in to the AWS Web Console for the lab environment at the provided URL with the supplied credentials.
- Log In to the EC2 instance and Load Data into Your Newly Created Table
- Log in to the provided EC2 instance with the provided IP and credentials.
- Run the
index_table_load
command to load data into your table.
- Verify the Table Contents and Test Querying Against the Indexes You Created
- Return to the AWS Web Console and verify the data has been loaded to the
album_indexed
table. Test querying against thetitle
andformat indexes
.
- Return to the AWS Web Console and verify the data has been loaded to the
- Run the Provided Test Utility and Observe the Results
- Return to the provided EC2 instance, run the provided
pineheadrecords_query
command, observe the results of the scan/filter against thealbum
table, and query against thealbum_indexed
table.
- Return to the provided EC2 instance, run the provided