AWS re:Invent 2019: Data modeling with Amazon DynamoDB (CMY304)
Why Stack Overflow recommends it
Stack Overflow users link it when answering DynamoDB schema questions from people used to SQL, as the standard introduction to access-pattern-driven, single-table data modeling.
Recommended by 5 people across 15 different months, 2019 to 2022.
What it is
A 40-minute AWS re:Invent 2019 session in which Alex DeBrie, creator of DynamoDBGuide.com, explains how to model data in DynamoDB. It covers key table design principles and practical patterns such as single-table design and one-to-many relationships.
What people said
Strong rec Seth Geoghegan · 2020-09 · Stack Overflow · on “How to implement one-to-many relationships with DynamoDB”
The question you are asking gets at the very essence of working with DynamoDB and NoSQL data modeling. It is not as simple as applying your relational database knowledge to DynamoDB. Take a moment to familiarize yourself with the DynamoDB basics before you get too far into solving this problem. Watch this video about modeling one-to-many relationships [this video] in DynamoDB. I would recommend you watch the entire video from the beginning, as it's one of the best introductions to the topic currently available.
Strong rec Seth Geoghegan · 2020-10 · Stack Overflow · on “How to do lazy loading or eager loading with dynamodb”
DynamoDB is a completely different paradigm than SQL databases. Storing Posts and Likes in their own tables is a common pattern in SQL databases, because you have the SQL join operation. You do not have a join operation in DDB, so you aren't going to get very far building your tables in this way. It's considered a best practice in DynamoDB to use a single table for your application and pre-join your data (remember, no joins). This probably means your Post and Like data will be stored together under the same partition key. I would recommend taking the time to watch this talk on data modeling [this video] in DynamoDB. This talk is among the best introductions to DDB date modeling that I've seen.
Strong rec Seth Geoghegan · 2020-11 · Stack Overflow · on “Should Dynamodb apply single table design instead of multiple table design when the entities are not relational”
NoSQL data modeling could be a field of study unto itself. Entire books are written on the subject. To get started quickly, I'd highly recommend watching this intro talk on DDB data modeling: [this video]
Strong rec Seth Geoghegan · 2021-01 · Stack Overflow · on “How to model a Manufacturer in DynamoDB”
As you're learning, NoSQL data modeling is completely different than data modeling in a SQL/relational database. Single table design requires you to think differently about your data, which can come with a steep learning curve. Alex Debrie, author of The DynamoDB Book [LINK] , has authored some of the best materials about data modeling in DynamoDB. His book is fantastic and I recommend it to anyone wanting to learn about NoSQL data modeling in DynamoDB. In your situation, I'd start by reading an article on modeling one-to-many relationships in DynamoDB [LINK] . You can also see the same material in this video [this video] presented at the 2019 AWS Re:Invet conference. Both of these resources will
Strong rec Seth Geoghegan · 2021-02 · Stack Overflow · on “How to organize DynamoDB tables to work with Users and Items?”
The answer to "how should I structure my data in DynamoDB?" will always depend on how you intend to access the data. For example, consider the following use cases: Fetch orders by username Fetch orders placed within the past 24 hours Fetch all users that ordered item X In DynamoDB, we store our data based on how our application needs to access the data (aka "access patterns"). Each of the access patterns I've outlined above may have entirely different data models. Thus, it's difficult to answer the question "how should I model my data" without knowing what you are trying to do with the data. The best way to start learning about DynamoDB data modeling is to watch this talk by Alex Debrie [VID
Strong rec Seth Geoghegan · 2021-04 · Stack Overflow · on “how to design db schema of an e-learning platform in dynamodb?”
Modeling one-to-many relationships (e.g. Users to Courses bought) within a single item is a common pattern. However, if the many side of the relationship can grow large, you will likely want a different approach. It sounds like you're use case ins't a good fit for this particular pattern. One way around this limitation is to model the relationship in an item collection . For example, you could model the user and the courses bought within the same partition. Keeping the data together makes it easier to fetch the data in a single query operation. [LINK] In this data model, I created a global secondary index named courses using the attribute GSIPK as the primary key for the secondary index. Thi
Strong rec Seth Geoghegan · 2021-06 · Stack Overflow · on “DynamoDb error Schema too big. Key Schema must at most consist of the”
In my data there are three forigen keys and one primary so How can I implement it This question suggests that you aren't clear on the differences between NoSQL and SQL databases. It looks like you're attempting to use a normalized data model (like you would with a SQL database) in DynamoDB. This is not the way to use DynamoDB. There's a lot of resources available online to teach NoSQL data modeling with DynamoDB. I would recommend you take the time to learn more about NoSQL data modeling before going any further. You will save yourself lots of time and frustration! Start with this talk by Alex DeBrie from the 2019 AWS Re:Invent conference [this video] . It's a fantastic resource to get started.
Strong rec Derrops · 2021-07 · Stack Overflow · on “Sorting not supported for scan expressions and no HASH key for GSI for DynamoDBPagingAndSortingRepository”
I really like this [this video] video showing how to design tables. But to get into finding the min/max/avg globally is not straight forward and you would need to use DynamoStreams. Otherwise you can do what you are doing but only within one partition at a time. That's key.
Strong rec Seth Geoghegan · 2021-07 · Stack Overflow · on “DynamoDB joins with multiple tables”
DynamoDB is a fantastic technology. However, it is completely different than SQL databases. As such, you'll need to approach the entire process differently than you would with a SQL database. Entire books have been written on the subject, so I won't try to cover all the differences here. However, I'll pass along a few pointers to get you in the right direction. Single table design is considered a best practice in DynamoDB. Having multiple tables isn't necessarily an anti-pattern, but spend some time investigating why this is the case. A good place to start: DynamoDB does not have a SQL join operation! The DynamoDB Book [LINK] is the best book on this topic, hands down. Spending just a few ho
Strong rec Charlie Fish · 2021-11 · Stack Overflow · on “One to many relation in Dynamodb Node js (Dynamoose)”
As of v2.8.2, Dynamoose does not support this. Dynamoose is focused on one directional simple relationships. This is partly due to the fact that we discourage use of model.populate . It is important to note that model.populate does another completely separate request to DynamoDB. This increases the latency and decreases the performance of your application. DynamoDB truly requires a shift in how you think about modeling your data compared to SQL. I recommend watching AWS re:Invent 2019: Data modeling with Amazon DynamoDB (CMY304) [this video] for a great explanation of how you can model your data in DynamoDB in a highly efficient manner. At some point Dynamoose might add support for this, but it's