Understanding the Azure Document DB
Azure DB is a subset of Azure DocumentDB is schema-free and combines rich and familiar SQL query capabilities with consistent low latencies on JSON-based data models, targeting solutions for web, mobile, gaming, and IoT. Since DocumentDB is schema agnostic, it makes it extremely easy to adjust and adapt data models on the fly as business logic and application scenarios change. With DocumentDB you no longer have to deploy constant updates to the data-tier and worry about managing schema and relationships. All content in DocumentDB is automatically indexed, which makes it possible to query data across entire structures at any time. The term “NoSQL” is more of a marketing buzzword, and actual means “no requirement for entity relationships and secondary indexing” in order to query information.
Terminologies related to DocumentDb
A database is a logical container of document storage partitioned across collections. It is also a users container.
The logical namespace for scoping permissions.
An authorization token associated with a user for access to a specific resource.
Arbitrary user-defined JSON content. By default, no schema needs to be defined nor do secondary indices need to be provided for all the documents added to a collection.
Hands On Demo
We are trying to create a MVC application and showcase the simple CRUD operations with Cosmos DB.
Go to Azure Portal and search for cosmos db.
You will get 4 Options Gremlin, MongoDb, SQL (DocumentDB) and Table (keyValue Pair). As we are working with DocumentDb so we are going to select the documentdb option and supply the necessary information like the resource group and where do you want to host your db.
Once the account is created, Go to the quick start option in the properties menu and then click on Create Items Collection Button. This will create a Collection in the database and then download the sample application.
Please note that you can either use the sample application or create your own application and add the documentDb client SDK via nugget. For this demo, we are g