Looking at your access patterns, this is a possible table design. I'm not sure if it's going to really work with your TimeId, especially for the Local Secondary Index (see note below), but I hope it's a good starting point for you.

# Table
-----------------------------------------------------------
pk       | sk                   | value | other attributes
-----------------------------------------------------------
TimeId   | GAME#TEAM{teamname}  | true  | ...
TimeId   | STATS#TEAM{teamname} |       | ...
GameId   | GAME                 |       | general game data (*)
TeamName | TEAM                 |       | general team data (*)
 
# Local Secondary Index
-------------------------------------------------------------------------------
pk from Table as pk | value from Table as sk | sk from Table + other attributes
-------------------------------------------------------------------------------
TimeId              | true                   | GAME#Team{teamname} | ...

With this Table and Local Secondary Index you can satisfy all access patterns with the following queries:

  1. Retrieve all games by timeId:

    Query Table with pk: {timeId}

  2. Retrieve all games per timeId and by TeamName

    Query table with pk: {timeId}, sk: GAME#TEAM{teamname}

  3. Retrieve all games per timeId and if value = true

    Query LSI with pk: {timeId}, sk: true

  4. Retrieve all teamStats per timeId

    Query table with pk: {timeId}, sk: begins with 'STATS'

  5. Retrieve all teamStats by timeId and TeamName

    Query table with pk: {timeId}, sk: STATS#TEAM{teamname}

*: I've also added the following two items, as I assume that there are cases where you want to retrieve general information about a specific game or team as well. This is just an assumption based on my experience and might be unnecessary in your case:

  1. Retrieve general game information

    Query table with pk: {GameId}

  2. Retrieve general team information

    Query table with pk: {TeamName}

Note: I don't know what value = true stands for, but for the secondary index to work in my model, you need to make sure that each combination of pk = TimeId and value = true is unique.

To learn more about single-table design on DynamoDB, please read Alex DeBrie's excellent article The What, Why, and When of Single-Table Design with DynamoDB.

Answer from Dennis Traub on Stack Overflow
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › data modeling for dynamodb tables › best practices for modeling relational data in dynamodb › example of modeling relational data in dynamodb
Example of modeling relational data in DynamoDB - Amazon DynamoDB
4 weeks ago - This example describes how to model relational data in Amazon DynamoDB. The DynamoDB table design corresponds to the relational order entry schema that is shown in Relational modeling.
🌐
Medium
arunrajeevan.medium.com › single-table-design-aws-dynamodb-cffd230a371f
Single Table Design — AWS DynamoDB | by Arun Rajeevan | Medium
January 29, 2024 - An Item collection in DynamoDB refers to all the items in a table or index that share a partition key. In the example below, we have a DynamoDB table that contains actors and the movies in which they have played.
Top answer
1 of 1
3

Looking at your access patterns, this is a possible table design. I'm not sure if it's going to really work with your TimeId, especially for the Local Secondary Index (see note below), but I hope it's a good starting point for you.

# Table
-----------------------------------------------------------
pk       | sk                   | value | other attributes
-----------------------------------------------------------
TimeId   | GAME#TEAM{teamname}  | true  | ...
TimeId   | STATS#TEAM{teamname} |       | ...
GameId   | GAME                 |       | general game data (*)
TeamName | TEAM                 |       | general team data (*)
 
# Local Secondary Index
-------------------------------------------------------------------------------
pk from Table as pk | value from Table as sk | sk from Table + other attributes
-------------------------------------------------------------------------------
TimeId              | true                   | GAME#Team{teamname} | ...

With this Table and Local Secondary Index you can satisfy all access patterns with the following queries:

  1. Retrieve all games by timeId:

    Query Table with pk: {timeId}

  2. Retrieve all games per timeId and by TeamName

    Query table with pk: {timeId}, sk: GAME#TEAM{teamname}

  3. Retrieve all games per timeId and if value = true

    Query LSI with pk: {timeId}, sk: true

  4. Retrieve all teamStats per timeId

    Query table with pk: {timeId}, sk: begins with 'STATS'

  5. Retrieve all teamStats by timeId and TeamName

    Query table with pk: {timeId}, sk: STATS#TEAM{teamname}

*: I've also added the following two items, as I assume that there are cases where you want to retrieve general information about a specific game or team as well. This is just an assumption based on my experience and might be unnecessary in your case:

  1. Retrieve general game information

    Query table with pk: {GameId}

  2. Retrieve general team information

    Query table with pk: {TeamName}

Note: I don't know what value = true stands for, but for the secondary index to work in my model, you need to make sure that each combination of pk = TimeId and value = true is unique.

To learn more about single-table design on DynamoDB, please read Alex DeBrie's excellent article The What, Why, and When of Single-Table Design with DynamoDB.

🌐
GitHub
github.com › aws-samples › amazon-dynamodb-design-patterns
GitHub - aws-samples/amazon-dynamodb-design-patterns: This repo contains sample data models to demonstrate design patterns for Amazon DynamoDB. · GitHub
This repo contains sample data models and source code to demonstrate design patterns for Amazon DynamoDB. Data models and source code are listed under the /examples folder.
Starred by 249 users
Forked by 46 users
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › dynamodb appendix › example tables and data for use in dynamodb
Example tables and data for use in DynamoDB - Amazon DynamoDB
This section presents sample tables and data for the DynamoDB Developer Guide, including the ProductCatalog, Forum, Thread, and Reply tables with their primary keys. It also includes information on a global secondary index for the Reply table and references to the Getting Started section for ...
🌐
Reddit
reddit.com › r/aws › dynamodb single table deign: simple guide to modeling & querying on to many relationships. (using excel to plan out the queries)
r/aws on Reddit: DynamoDB Single Table Deign: Simple Guide To Modeling & Querying On To Many Relationships. (Using Excel to plan out the queries)
October 3, 2022 - You would independently query your relationships and then populate a data schema with additional queries/batch gets for entities in the relationships. What you really can't do is arbitrary analytics. DynamoDB, and many NoSQL DBs, are great for transactional records (OLTP), and poor for analytical purposes (OLAP).
Find elsewhere
🌐
Upwork
upwork.com › resources › articles › what is dynamodb? basics, examples, and alternatives
What Is DynamoDB? Basics, Examples, and Alternatives - Upwork
September 27, 2023 - If you want to do more advanced querying, such as looking for strings that start with a specific substring, you can use a range key: the range key and the hash key combined need to be unique. In a user table, you could specify the email address to be a range key. Then, you can query for users whose emails start with “jane@,” for example. As mentioned, DynamoDB is essentially schemaless.
🌐
DbSchema
dbschema.com › blog › design › visual dynamodb design and documentation with dbschema
Visual DynamoDB Design and Documentation with DbSchema
January 12, 2026 - Hover over the column name in one table (for example, Orders.UserId). Click and drag the small key icon onto the matching column in another table (Users.UserId). Release the mouse button - DbSchema will draw a relationship line between the two tables. Optionally, right-click the line to set cardinality (one-to-many, etc.) or to rename the virtual key. These virtual links do not affect your DynamoDB data, but they make your schema easier to read and document.
🌐
Simple AWS
newsletter.simpleaws.dev › simple aws › dynamodb database design
Database Design in Amazon DynamoDB
January 12, 2026 - An example query would be PK="o#12345" and SK begins_with "i#" ... Querying a DynamoDB table on an attribute that's neither a PK nor an SK is extremely slow and expensive, since DynamoDB scans every single item in the table.
🌐
Sensedeep
sensedeep.com › blog › posts › 2021 › dynamodb-schemas.html
DynamoDB with OneTable Schemas | SenseDeep
March 13, 2022 - This makes understanding and working with single-table designs dramatically easier and allows another layer of capabilities over the raw DynamoDB engine. You can also use the SenseDeep Single Table Designer to help you create your OneTable schema via the GUI schema builder. When using OneTable, you define your your entities (models), keys, indexes and attributes via a OneTable Schema. This defines the possible entities and all their attributes. Attributes are specified with their type and other properties for OneTable to validate and control the attributes. For example, a OneTable schema for two entities and two indexes could look like this:
🌐
Theodo
blog.theodo.com › 2021 › 04 › introduction-to-dynamo-db-modeling
An introduction to DynamoDB data modeling - Blog - Theodo
April 12, 2021 - Discover how AI makes it possible to break free from legacy systems and unlock IT innovation · Discover how market leaders innovate, accelerate, and reinvent themselves alongside Theodo
🌐
Medium
medium.com › @QuinnMil › dynamodb-single-table-design-d60be6aa2298
DynamoDB Single Table Design. Getting the most out of Amazon… | by Quinn Milionis | Medium
June 22, 2023 - This is the essence of Single Table design” — using a single table to represent multiple record types and their relationships without the need for complex joins. In the given example, “account_id” acts as the shared index among all these record types. In DynamoDB, relationships are modeled within the data structure itself, eliminating the need for external table schemas or queries.
🌐
ScyllaDB
scylladb.com › learn › dynamodb › introduction-to-dynamodb
Introduction to DynamoDB | ScyllaDB
January 13, 2025 - As mentioned before, DynamoDB is a key-value store database that uses a documented-oriented JSON data model. Data is indexed using a primary key composed of a partition key and a sort key. There is no set schema to data in the same table; each partition can be very different from others.
🌐
Amazonaws
rh-web-bucket.s3.amazonaws.com › index.html
DynamoDB Data Modeler
See 'Editing Schema' section below for details. Click the sliders '' control to switch back to 'values view' and edit attribute values. ... The following image shows a data model for tracking patients, room assignments, and treatments for a hospital resource scheduling service originally created in NoSQL Workbench for DynamoDB (Hospital.json):
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › data modeling for dynamodb tables › data modeling schema design packages in dynamodb › social network schema design in dynamodb
Social network schema design in DynamoDB - Amazon DynamoDB
Now, let's step through how we'll evolve our schema design to address all the access patterns. Step 1: Address access pattern 1 (getUserInfoByUserID) To get a given user's information, we'll need to Query the base table with a key condition of PK=<userID>. The query operation lets you paginate the results, which can be useful when a user has many followers. For more information on Query, see Querying tables in DynamoDB. In our example...
🌐
Hevo
hevodata.com › home › learn › data integration
9 Best DynamoDB ETL Tools for 2025
January 12, 2026 - Real-time synchronization of DynamoDB tables with minimal latency · Advanced monitoring and logging to identify and resolve pipeline issues quickly · Flexible deployment across cloud, on-premise, or hybrid environments · Supports dynamic schemas, handling records without predefined columns.
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › best practices for designing and architecting with dynamodb › nosql design for dynamodb
NoSQL design for DynamoDB - Amazon DynamoDB
In a NoSQL database such as DynamoDB, data can be queried efficiently in a limited number of ways, outside of which queries can be expensive and slow. These differences make database design different between the two systems: In RDBMS, you design for flexibility without worrying about implementation details or performance. Query optimization generally doesn't affect schema ...
🌐
AWS re:Post
repost.aws › questions › QUHVoWm0ByRU2BQCjXTCK_pQ › import-existing-dynamodb-table-schema-to-nosql-workbench-s-data-model
Import Existing DynamoDB table schema to NoSQL workbench's Data model | AWS re:Post
April 5, 2024 - How do I resolve the "Provided key element doesn’t match the schema" error I receive when I use Hive on Amazon EMR to import DynamoDB tables?
🌐
DataCamp
datacamp.com › tutorial › single-table-database-design-with-dynamodb
Performance and Scalability Unleashed: Mastering Single Table Database Design with DynamoDB | DataCamp
September 7, 2023 - This final example shows a customer’s order history with two products made from two different order IDs. For those interested in how data modeling works in SQL databases, our Data Modeling in SQL webinar offers valuable insights that can complement your understanding of NoSQL data modeling. Using a single table design with DynamoDB offers many advantages, but it also presents several challenges and considerations: