DocumentDB is a NoSQL database supports fast performance, ease of development and high availability. Its schema –free NoSQL database. As data is stored in JSON format reads and writes are served under 10 milliseconds. DocumentDB is ideal for developing web, mobile, gaming and IoT applications. You can use SQL like language to query the DocumentDB data.
All the data that you stored in DocumentDB is automatically indexed so you can query anything at any time. DocumentDB also enables you to leverage existing JavaScript skills to execute transactional application logic over multiple documents using JavaScript based triggers, user-defined functions and stored procedures. It easily integrates with existing Azure services to simplify modern application development.
Creating DocumentDB on Azure
Create a DocumentDB service using Azure portal as follows
Open the created DB and add a database and collection as follows
Add a document to the database as shown follows
Open the query explorer to query the data like sql
Connecting DocumentDB using Visual Studio
Open Visual Studio and create a new project for connecting DocumentDB, install Microsoft.Azure.DocumentDB package
Add the following namespace to code file
Copy the endpoint URI and Primary key from Azure Portal
Write the following code to establish the connection to the database
Write the following code to establish the connection to the database