Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

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 ?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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 for idea's about how to handle relationships inside of MongoDB

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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