Thursday, January 1, 2015

JSON vs RDBMS

Say Adarsh has two child  ages 15 & 19 then in  RDBMS  we may have to create Two tables if we need data normalized


tab_person
-------------------------
Person |  Name   |    _id |
-------------------------
1         | Adarsh   |    x |
--------------------------

tab_children
---------
id  | Age |
---------
x | 15 |
x | 19 |
-------

In JSON we can write the above in a single Document

JSON
{
 person:1,
 name:"Adarsh",
 ChildAges:[15,19]
}