I come from relational database background and I'm struggling with the concepts of a single table to represents all my data in DynamoDB.
My application has Manufacturers and they give access to their staff to my portal CRM (Manufacturer Users). The Users then add their own customers to the system and log and record all their orders.
- GetManufacturer()
- GetManufacturerUsers()
- GetManufacturerCustomers()
- GetManufacturerCustomersOrders()
A Manufacturer will never see another Manufacturers Customers orders.
I understand the basics around PK and SK, my question is... really? Is this really single table?
Table Customer Accounts
- Manufacturers
(Name, logo etc)
- Manufacturer Users
(Users of that Manufacturer that access my system i.e. email, role)
- Customers of the Manufacturer (custID, Name Manufacturer they belong to)
- Customer transaction data (lots of it)
Given the above, how would you model in DynamoDB?
Access pattern stories
- Query Manufacturer (Login, Name) by Users SK ManufacturerID
- Get all Customers IDs and Name by ManufacturerID Filter by UsersID
- Get all Orders filtered by CustomersID and ManufacturerID
- Get all Ordered Items filtered by OrdersID and CustomersID