DocumentDB is Microsoft’s newest NoSQL document database platform that runs on Azure. DocumentDB is designed keeping in mind the requirements of managing data for latest applications. This tutorial explains the basics of DocumentDB with illustrative examples.
Audience
This tutorial is designed for beginners, i.e., for developers who want to get acquainted with how DocumentDB works.
DocumentDB – Introduction
In this chapter, we will briefly discuss the major concepts around NoSQL and document databases. We will also have a quick overview of DocumentDB.
NoSQL Document Database
DocumentDB is Microsoft’s newest NoSQL document database, so when you say NoSQL document database then, what precisely do we mean by NoSQL, and document database?
- SQL means Structured Query Language which is traditional query language of relational databases. SQL is often equated with relational databases.
- It’s really more helpful to think of a NoSQL database as a non-relational database, so NoSQL really means non-relational.
There are different types of NoSQL databases which include key value stores such as −
- Azure Table Storage.
- Column-based stores like Cassandra.
- Graph databases like NEO4.
- Document databases like MongoDB and Azure DocumentDB.
Azure DocumentDB
Microsoft officially launched Azure DocumentDB on April 8th, 2015, and it certainly can be characterized as a typical NoSQL document database. It’s massively scalable, and it works with schema-free JSON documents.
- DocumentDB is a true schema-free NoSQL document database service designed for modern mobile and web applications.
- It also delivers consistently fast reads and writes, schema flexibility, and the ability to easily scale a database up and down on demand.
- It does not assume or require any schema for the JSON documents it indexes.
- DocumentDB automatically indexes every property in a document as soon as the document is added to the database.
- DocumentDB enables complex ad-hoc queries using a SQL language, and every document is instantly queryable the moment it’s created, and you can search on any property anywhere within the document hierarchy.
DocumentDB – Pricing
DocumentDB is billed based on the number of collections contained in a database account. Each account can have one or more databases and each database can have a virtually unlimited number of collections, although there is an initial default quota of 100. This quota can be lifted by contacting Azure support.
- A collection is not only a unit of scale, but also a unit of cost, so in DocumentDB you pay per collection, which has a storage capacity of up to 10 GB.
- At a minimum, you’ll need one S1 collection to store documents in a database that will cost roughly $25 per month, which gets billed against your Azure subscription.
- As your database grows in size and exceeds 10 GB, you’ll need to purchase another collection to contain the additional data.
- Each S1 collection will give you 250 request units per second, and if that’s not enough, then you can scale the collection up to an S2 and get a 1000 request units per second for about $50 a month.
- You can also turn it all the way up to an S3 and pay around $100 a month.