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


id-|- Description|




student_id -|- field_name -|- Value

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



id-|- Description|


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 ?

1 Answer 1


There is nothing wrong with either approach from what I can tell, it is more a requirements/learning question. If you want to learn MongoDB then you can make it work. If you need it to work and there are no other advantages then your MySQL schema will work fine.

If you are interested in doing your work in MongoDB then I would suggest looking at http://www.mongodb.org/display/DOCS/Schema+Design for idea's about how to handle relationships inside of MongoDB

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.