Now today is a day to discuss one of the most important NoSQL Data Model that is known as Document Based Store Data Model.
Some of the most popular document databases are: MongoDB, CouchDB, OrientDB, Terrastore.
A keyword “document” is a central word for Document Based Store Data Model.
It is very similar to Key Value Store Data Model and the difference is a whole document stored as a value which is referred by a unique key.
The Key always should be a unique and column name usually starting with “_id”.
We can store and retrieves the document using different format like, JSON, BSON, XML, and any other custom format.
It is also supporting query languages and the concepts of database index.
Each and every document are self-describing and follow the hierarchical tree data structures.
We can also create a nested document like any other parent and child model. But unfortunately we cannot apply any kind of JOINS in a query and we have to manage this JOINS in an application side.
At any given point of time We can add or remove columns from the document because this architecture is fully schema free and flexible , in which each record can have different type of document data and each document has an independent structure.
We can use this model for real time application like Blogging. In a blog, we have N number of articles which has N number of comments. Each article has a multiple category and author details.
For this kind of application, We require 100% scalability which is given by this model.
The sample document for Blog:
"title": "What is NoSQL?",
"A NoSQL database provides a mechanism for
storage and retrieval of data which is modeled
in means other than the tabular relations used
in relational databases."
["email": "firstname.lastname@example.org","body": "Nice post !"],
["email": "email@example.com","body": "Nice,I am sharing !"],
["email": "firstname.lastname@example.org","body": "The best post !"]