Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

There is a relational database with the following Users table

User
Id
Name
Age
Parents
Friends
Colleagues
...

And there are tables Parents, Friends, Colleauges, etc. Due to specifics of database this part of User info is actually a single document that is always used as whole piece

Parents
Friends
Colleagues
...

Are there any advantages to remove all this tables and use the following Users table instead

User
Id
Name
Age
People

Where people are document with a special structure, for example, JSON or XML? This database is not truely relational. Will it be faster, easier to develop and maintain, etc.?

share|improve this question
2  
I don't understand your current structure. Do you have a single field that lists all the parents/friends/colleagues? –  JNK Mar 12 '12 at 20:30
    
Currenty I have traditional relational design where several tables (Parents, Friends, Colleagues, ...) link to another table (Users) through foreign key. I am going to keep only one table (Users) which has single field (People - in TEXT format) that holds all the data of removed tables for specific user in JSON format. –  Иван Mar 13 '12 at 6:40
add comment

1 Answer 1

up vote 2 down vote accepted

"Are there any advantages to remove all this tables and use the following Users table instead"

It depends. Are you talking about a lot of rows? Or just a few? How about the number of different data fields in a "People" document? Parsing something like that (for a lot of fields) is not going to be easy or performance-friendly. Especially if the fields are not consistent across the documents.

"Where people are document with a special structure, for example, JSON or XML? This database is not truely relational"

Given these statements (and others) it almost sounds to me like this particular instance would be better served with a (NoSQL) MongoDB solution. Essentially, you could have a "People" database and save collections of "Parents", "Friends" and "Colleagues." MongoDB stores documents in collections as BSON, or a binary-encoded serialization of JSON.

Here's a link to the MongoDB site which explains a little about BSON and MongoDB. Hope this helps.

share|improve this answer
add comment

Your Answer

 
discard

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.