What is a Document Database?
A document database,also called a document store or document-oriented database,is a subset of a type of NoSQL database.Some documents stores ma also be key-value databases(Like Redis).A document database is used for storing,retrieving,and managing semi-structured data.Unlike traditional databases,the data model in a document database is not structured in a table format of rows and columns.The schema can vary,providing far more flexibility for data modelling than relational databases.
- A document is a JSON object
- Database stores data in document
- Database indexes of properties of documents and allows runing queries against them
Document Db | Relational Database |
De-normalized data | Normalized data |
Referential Integrity NOT enforced | Referential Integrity enforced through |
Mixed data in collections | Uniform data in tables |
Flexible schema | Schema is set-through can be charged |
SQL-like language as well as Javascript | SQL |
Service on Microsoft Azure.Can not run it on a server | Runs on pysical/virtual server |
Collections.Do not use them as tables | Tables |
Other document databases : MongoDb,CouchDb,RavenDb,Amazon SimpleDb
Why I chose Azure Cosmos Db?
*It is a service
No need to worry about underlying technologies i.e OS,database upgrades,hotfixes,etc.
*Metered-Pay for what you use.Not cheap though!
*High performance – Read times <10 ms
*Super scalable
*Supports MongoDb protocols
*Save your POCO objects directly in database w/o any ORM mapping