While the question on how to model 1 to many relationships is well answered on stackoverflow, I couldn't find any information for hierarchical lookup where every intermediate level must be accessible.
Let's assume the following entities: Accounts
Group
Instances
InstanceProviders
.
One account has multiple groups. One account has configured multiple InstanceProvider accounts. One group has access to multiple instances, one instance is assigned to one group only. The group name can be chosen freely and is tied to the account. Hence it must be unique on the account level.
The external instance name is provided by the InstanceProvider, uniquely within Account-InstanceProvider-InstanceId
.
Now I need to answer the following read patterns:
Restrictions:
The "Read all" part is where I am struggeling. These lookup would require an GSI each per level, since every sub-level is dependent on the level before it.
Like for one Instance
Here it's basically one GSI per attribute "chain". Is there a better way?
According to best practices for managing many-to-many relationships by AWS, I think you are doing great.
From my experience, I think you are doing the adjacency list design pattern which
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.