choosing Database and Its Design for Rails

Posted by Gaurav Shah on Programmers See other posts from Programmers or by Gaurav Shah
Published on 2012-03-30T09:35:06Z Indexed on 2012/03/30 11:40 UTC
Read the original article Hit count: 575

Filed under:
|
|
|

I am having a difficulty in deciding the database & its structure.

Let us say the problem is like this. For my product I have various customers( each is an educational institute) Each customer have their own sub-clients ( Institution have students)

Each student record will have some basic information like "name" & "Number" . There are also additional information that a customer(institution) might want to ask sub-client(student) like "email" or "semester"

I have come up with two solutions : 1. Mysql

_insititution__

id-|- Description|


__Student__

id-|-instituition_id-|-Name-|-Number|


__student_additional_details__

student_id -|- field_name -|- Value


Student_additional_details will have multiple records for each student depending upon number of questions asked from institution.

2.MongoDb

_insititution___

id-|- Description|


_Student__

id-|-instituition_id-|-Name-|-Number|-otherfield1 -|- otherfield2


with mongo the structure itself can be dynamic so student table seems really good in mongo . But the problem comes when I have to relate student with institution .

So which one is a better design ? Or some other idea ?

© Programmers or respective owner

Related posts about database

Related posts about ruby-on-rails