The more I watch Rick's sessions from 2017, 2018 and 2019, more confused I get - so I guess I'd write it down.
There are 3 core steps (some have more, I want to stick to 3) to create a decent model that works well:
- Understand the usecase + create ERD(list entities and relations)
- Identify the access patterns - R/W workloads, query dimensions and aggregations
- Data modeling - avoid relational patterns, use 1 table(if there aren't any "documents", 1 should be fine)
- R.R.R = Review > Repeat > Review (go on till it makes sense)
From DynamoDB POV, the PK/SK structure would look something like this:
For "users":
PK = USER_{email-goes-here}
SK = TRUE or FALSE (depicting "active" status)
meta = JSON
For "connections"
PK = CONN_{ID-goes-here}
SK = TRUE or FALSE (depicting "active" status)
meta = JSON
For "permissions"
PK = PERM_{email-goes-here}
SK = {connection-ID-goes-here}
meta = JSON