Data Tables¶
From the relationship between data tables we analyzed above,
we derive three data tables: users, projects, files.
The User entity set is mapped to users table.
Likewise, File is mapped to files table.
However, most other entities are stored within a single table projects,
forming a typical tree-like structure of document-oriented database.
For example, two entities Artifacts storing revisions for report and slides
are included within a table row.
Tasks are stored in an array in the project.
The many-to-many relation between User and Project
is realized using foreign keys with secondary index in this table as well:
Each row in
projectshas asupervisorsand astudentsfields. We model both of these fields as lists, since there can be occasions where two or more supervisors co-supervise a project.A secondary index named
memberswas created for these fields for the ease of querying projects a certain user participates in.
Within each task is a discussion thread with a forest structure of Comment
entities. There are several root comments within the discussions.
Each comment can contain some child comments.
- 1(1,2,3,4)
The JSON structure is visualized by PlantUML. Source text used can be found at https://github.com/Huy-Ngo/acanban/tree/main/docs/source/meth/database/tables/images