Case study: Structured data

Subjects

This is a denormalised model using the capabilities of a document database system. Instead of the papers pointing 'up' to the address of the subject document. The papers are listed in the subject document.   See how this works here. Click 'Edit' to see how papers are added and removed.  The schema for the subjects collection is here.

Students

In this example we can keep all the information about a student in one record including the personal information like name and address and the subjects taken and exam scores.  We are using the collection of subjects from the previous simple example.  

Exam paper Subject 1 Subject 2
Paper 1 x x
Paper 2 x x
Paper 3 x  

See this in action here to log in to this demonstration.   Click on 'more...' to see the subject, papers and scores.

Click edit to see how this information is edited.  The top level fields are in bold type. So the address is split into separate fields. There are a couple of subjects, and under this there are some papers and results. You can add or remove subjects and results without leaving the page.  

The schems for the student collection is here

The schema for this data is a bit more complex.  Because we have two levels of lists you have to select the subject before you can see the list of matching papers to select from. This means that the page has to query the database while you still have the page open. In fact when you click on the select field for the paper, the systems queries the database and sets up the papers list immediately.   You may see 'please wait'  while this happens. This procedure needed some custom Javascript code to be written (around 20 lines of code).   The schema for this table is here. The custom code is here.

Next: Variable data