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 Module: 20 Minutes


  • Step 1: 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.

  • Step 2: Delete the AWS Cloud9 environment

    To delete the AWS Cloud9 environment that you used in this lab:

    1.  Navigate to the AWS Cloud9 console.
    2.  Choose the DynamoDB Battle Royale environment and choose Delete.
    3.  In the dialog box, type Delete in the box, and choose Delete.
    Module7-step2

    (Click to enlarge)

    Module7-step2