1 Answer
- Newest
- Most votes
- Most comments
1
You're correct that you would not normally create "join" scenarios for DynamoDB. Typically you would have an individual item for each Agent:
PK | SK | other | other-1 |
---|---|---|---|
01202333444 | C#01202333444 | 1/1/2023 | Call metadata |
01202333444 | Bob | 1/1/2023 | Data |
01202333444 | Michelle | 1/1/2023 | Data |
01202333444 | Lee | 1/1/2023 | Data |
In DynamoDB and other NoSQL databases its common to de-normalize the data, which takes a little bit of getting used to coming from a relational database background.
Relevant content
- asked 10 months ago
- asked 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
Thanks Leeroy
I could denormalise to the following:
Incoming Number StartTime PrimaryAgent SecondaryAgent 01202333444 1/1/2023 Bob Michelle
but then, what happens if there's another agent?
I edited my answer to show how I would model the data
so, if I do a search for 01202333444, I'd get one record for each of the agents involved in the call, rather than just one record for the call?
Yes and you would also get the call metadata. The cost of reading does not change as you still pay up to the nearest 4KB.
not sure I like that, to be honest. A user would see two calls where there are actually only one, and this would confuse them. Thanks for your help though, Leeroy