In the previous sections, we’ve satisfied the following access patterns in our application:

  • Create user profile (Write)
  • Update user profile (Write)
  • Get user profile (Read)
  • Upload photo (Write)
  • View recent photos for user (Read)
  • React to a photo (Write)
  • View photo and reactions (Read)
  • Follow user (Write)
  • View followers for user (Read)
  • View followed for user (Read)

The strategies we used to satisfy these patterns included:

  • A single-table design that combined multiple entity types in one table.
  • A composite primary key that allow for many-to-many relationships.
  • An inverted index to allow reverse lookups on our many-to-many entity.
  • Partial normalization to keep our data fresh while remaining performant.
  • DynamoDB transactions to handle complex write patterns across multiple items.

In the steps below, we’ll run through the steps to clean up the resources we created in this lab.

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, there is a file in the scripts/ directory called delete_table.py. The contents of that file are as follows.

    import boto3
    
    dynamodb = boto3.client('dynamodb')
    
    try:
        dynamodb.delete_table(TableName='quick-photos')
        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

    The script should print 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 Quick Photos environment and choose Delete
    3. In the dialog box, type Delete in the box, and choose Delete.
    Clean-up_step2

    (Click to enlarge)

    Clean-up_step2