This article is half-done without your Comment! *** Please share your thoughts via Comment ***
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 retrieve the document using the different format like JSON, BSON, XML, and any other custom format.
It is also supporting query languages and the concepts of database index.
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 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 the real-time application like Blogging. In a blog, we have N number of articles which has N number of comments. Each article has multiple categories and author details.
For this kind of application, We require 100% scalability which is given by this model.
The sample document for Blog:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
{ "_id": "Article_1", "title": "What is NoSQL?", "author": "Anvesh", "category": "NoSQL", "body": "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." "comments": [ ["email": "neevan@gmail.com","body": "Nice post !"], ["email": "roy@gmail.com","body": "Nice,I am sharing !"], ["email": "martin@gmail.com","body": "The best post !"] ] } |