Data modeling example
As data modeling concept is explaind, we will look at an example data model for simple mobile application “MyNoteApp”.
- We are to create a mobile application which allows users to take note under different categories.
- So we need to store category data and category will have name.
- And we need to store note data which has title, content and, date and time of note created_at.
- So we define an App named MyNoteApp.
- MyNoteApp has two Resource types, category and note.
- category resource has only one attribute name as String.
- note resource has three attributes title and content as String, and created_at as DateTime data.
- Each note is taken under a category, thus note resource belongs to category resource.
Following diagram shows MyNoteApp’s data model;
We can implement the conceptual model under Dashboard > Define tab, in CloudyRec.
Create new app by just typing in the App name.
App is successfully created.
Define note resource type
Select the newly created App to view the resource list and form. Then create new resource by providing the resource name note.
Define category resource type
Create new resource type category.
Define attribute for category
Select newly created resource type category to view the attribute list and form. Then provide the attribute name, and select the data type to store.
Define attributes for note
Similarly define the attributes for note.
Define association between note and category
Open the resource type note in edit mode and select the belongs to value to category.
note is marked with small arrow to show that it belongs to other resource type category.