#1 2014-05-09 18:08:01

ComingNine
Member
Registered: 2010-07-29
Posts: 294

How to model "Classroom - Class" relationship using sharding ?

Sorry for this newbie question !

The sharding facilitated by mORMot sounds very interesting ! I want to learn this practice with a "Classroom - class" relationship:

"Classroom" :
(1) "Classroom" instances, which will be available for a certain period (e.g., half a day), will be announced.
(2) Each "Classroom" can accommodate one "Class" at a given time. 
(3) Once "Classroom" is free from a previous "Class", it may accommodate another "Class".

"Class"
(1) "Class" instances, which will need to be taught at a given time, will be announced.
(2) Each "Class" will be taught in one "Classroom" at a given time.

With multiple-table-paradigm, a new "Assignment" table can help to model this relationship.

Right now I don't have any idea how to model this relationship using sharding. Could you help to give me some suggestions ?

If it is not possible to use sharding, could you help to comment how to identify whether sharding fits a relationship in practice ?

Many thanks for your time and comments !

Offline

#2 2014-05-10 11:26:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: How to model "Classroom - Class" relationship using sharding ?

Please ensure you read the "sharding" information in the latest SAD pdf.
And also the general introduction to NoSQL / normalization / denormalization in it.
You will find some rules in there.

Offline

#3 2014-05-10 11:31:46

ComingNine
Member
Registered: 2010-07-29
Posts: 294

Re: How to model "Classroom - Class" relationship using sharding ?

Thanks for your comments. I have been reading your SAD document but have no clue.

Do you mean it is possible to model this "classroom-class" relationship using sharding ?

If you think this is an improper question for you, please just say so . smile

Offline

#4 2014-05-10 13:07:59

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: How to model "Classroom - Class" relationship using sharding ?

In short, you "denormalize" data according to the requests you may potentially need.

But since the same data can now be at several places in the database, you have to ensure its coherency.

That is, once data is denormalized, you should ensure that any modification in one place will also be manually modified in the other places - unless you do not need the update (if e.g. it's OK for you that the "old" value remains untouched, as its historical value).

Offline

Board footer

Powered by FluxBB