Getting Started with DynamoDB Schemas

1 Minute

06/01/2021

Introduction

Sample Data

Process

Define Access Patterns

To get started, write down all the ways that you'll need to get data from the table. These should be human-readable. I also like to Include some variables that will be used in the queries.

Access Pattern
Get all movies that actor stared in
Get details about actor

Create Mock Queries

Once you have all of your access patterns defined, try to create mock queries for each one. These will simply be trying to create hash and possibly sort keys from the variables that you added in the access patterns.

Access Pattern Query
Get all movies that actor stared in pk = and sk begins_with Movie#
Get details about actor pk = and sk =

Plan Attributes

Create LSI/GSI

Sharding

Creating Queries

Conclusion