The same question is like in the topic.
When using AWS documentation, they recommend that you keep your related data in one table. But reading the various comments from other users, for the most part, I saw not to use nested objects (list of maps). So what is it really supposed to look like?

- 491
- 3
- 13

- 21
- 6
1 Answers
When we use maps/lists, we are often modeling one-to-many relationships. For example, here's an example where I model the relationship between Users and their Hobbies.
This strategy works fine to model one-to-many relationships if you don't have any access patterns around searching users by hobby. For example, if your access pattern includes "fetch all users who like photography", this is not a good way to store your data. Instead, you may consider storing hobbies like this
This data model allows you to fetch users by hobby, something you couldn't do in the prior example.
There is no single way to model data in DynamoDB. Instead, there are common strategies and patterns that model various relationships (one-to-many, many-to-many, etc). The best strategy for any particular situation will depend on the needs of your application.

- 5,372
- 2
- 8
- 23
-
If you could look at this topic: https://stackoverflow.com/questions/69944349/dynamodb-how-to-use-scanasync-on-a-nested-structure Is this structure correct? Maybe you have idea what i should do ? – Franczyk Rafał Nov 13 '21 at 19:30
-
I had a peek at your other question. I don't know much about .NET, so I'm afraid I won't be of much help there. It sounds like you're having trouble understanding how to interact with the DynamoDB API. I recommend watching the 2019 AWS Re:Invent talk from Alex Debrie to understand the fundamentals: https://www.youtube.com/watch?v=DIQVJqiSUkE&ab_channel=AWSEvents – Seth Geoghegan Nov 14 '21 at 12:27