CDLUC3 / dmsp_aws_prototype

Sceptre CloudFormation templates for DMPHub v2
MIT License
1 stars 0 forks source link

Define new data model #79

Closed briri closed 2 months ago

briri commented 6 months ago

We need to define the data model for the new DMSP system. It is assumed that we will need to add additional columns to tables as we begin to build out the workflows for the UI and discover information that will need to be persisted to support the UI.

Outstanding questions: Should we host everything in DynamoDB or leave registered DMPs in DynamoDB and then all of these tables in a MySQL or Postgres DB on RDS?

The structure of the records/entries will be significantly different in Dynamo vs RDS. For example, the Customization table would look like the following:

Regardless of which DB technology we use, we will make heavy use of JSON data structures.

One benefit to using JSON data structures is from the perspective of making the code open source friendly and more reusable. Our UI implementation for example may have a need to store data that is only relevant to the UI between pages and/or sessions. By using a schema less JSON data type, we remove the tight connection between the front end and the back end.

Notes: All of the tables below are assumed to have created and updated timestamps. They will also have their own internal id If we decide to host the tables in a relational DB, this can just be the auto increment field.

If we opt to store this data in DynamoDB, then any table below with a family_id will use that value as the PK and will use the SK to support versioning like we do with DMP IDs.

If we use DynamoDb we will want to update the DMP ID record so that it has a registered timestamp and put logic into place to only trigger EZID registration once the DMP is ready. We may also want to just merge the Drafts and Dmps into the same table and have a flag to indicate the difference.

Table Definitions: untitled_page

Tags (formerly Themes)

TagGuidance

QuestionType

Question

Overlay (formerly Customization)

Template

Draft

DMP

Org

User

Notification

briri commented 6 months ago

Use Cases and the queries needed: Oauth Grant exchange for Token

User Authentication (OAuth callback target)

Typeahead / Search Queries

Canned

Public Plans

Dashboard

Authoring DMP

Org Admin

Super Admin (Same query structures as Org Admin but ability to see ALL and DEFINE DEFAULT/GLOBAL)

mariapraetzellis commented 2 months ago

We'll be addressing this for each section of the application so closing this ticket