I m 利用DynamoDB作为数据库建造一台仪器。 我有用户、组织、项目和文字的概念。
- An Organization has many projects
- A project or organization has many scripts
- A user can be part of a single organization so an organization can have many users.
- A script can either belong to a project or an organization. Each script has revisions which needs to be store so that users can rollback to previous version.
(a) 利用案件需要查询:
- Get all users belonging to a organization
- Get all projects belonging to a organization
- Get all scripts belonging to a project
- Get script by id
- Get all versions of the script by script id
- Get latest version of the script by script id
- Get organization by org id
- Get project by project id
- Get script by script id
我正在考虑建立一个单独的表格<代码>Entities:
pk | sk | type (gsi1-pk) | parent (gsi1-sk) |
---|---|---|---|
root#org-1 | info | org | root |
org-1#proj-1 | info | project | org-1 |
proj-1#script-1 | info | script | proj-1 |
proj-1#script-1 | rev_latest | script_revision | script-1 |
proj-1#script-1 | rev_1 | script_revision | script-1 |
proj-1#script-1 | rev_2 | script_revision | script-1 |
org-1#user-1 | info | user | org-1 |
org-1#user-2 | info | user | org-1 |
PK和SK将允许我获得提供该身份证的具体项目的数据。 关于我亲子的id子和需要打孩子的问题,我会创立一个GSI并对此提出质询。
就PK而言,我可以放弃第一张前标,因为上面在括号中界定了多余的母物体,但我离开这里来防止意外的交叉物体更新。
我更能用多张DynamoDB表格储存这一信息?
出于经济原因,我宁愿不使用扫描查询。 理想的情况是,我可以通过查询和扫描操作获得所有数据。