Modeling Game Player Data
with Amazon DynamoDB
Module 5: Clean up and next steps
To finish this experiment, you will clean up the resources created in this lab
Overview
In the previous modules, we satisfied the following access patterns in our game:
- Create user profile (Write)
- Update user profile (Write)
- Get user profile (Read)
- Create game (Write)
- Find open games (Read)
- View game (Read)
- Join game for a user (Write)
- Start game (Write)
- Update game for a user (Write)
- Update game (Write)
- Find games for user (Read)
The strategies we used to satisfy these patterns include:
- A single-table design that combines multiple entity types in one table.
- A composite primary key that allows for many-to-many relationships.
- A sparse secondary index to filter on one of the fields.
- DynamoDB transactions to handle complex write patterns across multiple entities.
- An inverted index to allow reverse lookups on the many-to-many entity.
In the following steps, we clean up the resources we created in this lab. It is important to delete these resources so that you do not incur additional AWS charges.
Time to Complete
20 minutes
Services Used
Implementation
-
Delete the DynamoDB table
As part of the cleanup process, you need to delete the DynamoDB table you used for this lab.
In the code you downloaded, a delete_table.py script is in the scripts/ directory. The contents of that file are as follows.
import boto3 dynamodb = boto3.client('dynamodb') try: dynamodb.delete_table(TableName='battle-royale') print("Table deleted successfully.") except Exception as e: print("Could not delete table. Please try again in a moment. Error:") print(e)
In your terminal, run the following command to run this script and delete your table.
python scripts/delete_table.py
Your terminal will display a message indicating the table was deleted successfully.
-
Delete the AWS Cloud9 environment
To delete the AWS Cloud9 environment that you used in this lab:
- Navigate to the AWS Cloud9 console.
- Choose the DynamoDB Battle Royale environment and choose Delete.
- In the dialog box, type Delete in the box, and choose Delete.