- Newest
- Most votes
- Most comments
Here is official documentation
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.CLI.html
It took me a while to get used to the fact that DynamoDB wasn't a relational database. Basically, you need to go ahead and generate a precomputed column, possibly with a key that combines values from multiple other fields, or possibly use post-query filtering, for things you would have done with a union. This may mean more records are needed for a single datum to support the different kinds of access, but the assumption is that storage is cheap. Setting the maximum number of returned results together with the direction of sorting can help reduce that to the intended record.
For example: My first draft of my podcast-like app had one table for details about an episode, and one table mapping broadcast date to episode (because episodes may be rebroadcast). In DynamoDB, there's instead a record ("item") for every broadcast date with no attempt to optimize rebroadcasts. If I'm fetching by date, that works directly. If I'm searching by episode number, I use a secondary key which sorts by that field and tell it to stop after finding one record (I usually don't care which one since outside of date they all have the same values).
Best advice I have is to not try to bring relational experience to it, and instead go through the DynamoDB tutorials. They'll show you what Dynamo can and can't do, and how to cheat it into doing some things by using additional and/or non-obvious keys.
Relevant content
- Accepted Answerasked 2 years ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago
Have a look here https://medium.com/@corymaklin/tutorial-aws-part-5-the-basics-of-dynamo-db-amazons-non-relational-database-9be0cf500e6e