Techbubbles

Azure DocumentDB overview

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.

image

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

image

Open the created DB and add a database and collection as follows

image

Add a document to the database as shown follows

image

Open the query explorer to query the data like sql

image

Connecting DocumentDB using Visual Studio

Open Visual Studio and create a new project for connecting DocumentDB, install Microsoft.Azure.DocumentDB package

image

Add the following namespace to code file

image

Copy the endpoint URI and Primary key from Azure Portal

image

Write the following code to establish the connection to the database

image

Write the following code to establish the connection to the database

image

 

 

 

 

Related Posts:

%d bloggers like this: