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.

../../../_images/student.svg

Figure 30 An example database row for student. 1

../../../_images/file.svg

Figure 31 The structure of database table file. 1

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 projects has a supervisors and a students fields. 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 members was created for these fields for the ease of querying projects a certain user participates in.

../../../_images/project.svg

Figure 32 The structure of database table projects. 1

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.

../../../_images/discussion.svg

Figure 33 The forest structure of discussion field. 1

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