Azure Cosmos Db – Part two – Understanding the Azure Cosmos DB Concept
Microsoft started a project in 2010 called “Project Florence” in order to address the difficulties faced by the developers while developing the large scale applications inside Microsoft. The difficulties were so common across the developers inside and outside Microsoft that they decided to release this as a product in the form of Azure Document DB in 2015. Azure Document DB was immediately a hit with NoSQL developers who wanted to move to cloud and with document based database it was quite simple to adopt the new technology. After the success of DocumentDb, Microsoft decided to roll of Azure CosmosDB which is built on the same design of Azure Document DB and released as a superset of DocumentDb.
If you’re not familiar with the NoSQL and SQL difference, I urge you to go through my article on it first.I think Azure CosmosDb is the one of the biggest announcement of the build 2017 and it is one place service for all our NoSQL requirements. If you have not gone through my article on the NOSql, I request you to go through it to understand the azure cosmos db.
Azure CosmosDb gives the option to store the data in a KeyValue Pair, Column based database, and Document based database as well as the Graph Database. It right now support azure tables, MongoDb, SQL, and DocumentDb & Gremlin while writing this article. Microsoft indicated that they are going to be adding more service under this umbrella which is going to make it much more powerful. These capabilities are in the areas of the core database engine as well as global distribution, elastic scalability, and industry-leading, comprehensive SLAs.
For the existing DocumentDb Customers, the transaction is going to be seamless. The DocumentDb Account is going to move under the cosmosDb account and all your collections and data will remain intact. Also, the same client SDKs will continue to work and you don’t need to make any code changes inorder to continue with the documentDb application.
Design Goals of Azure Cosmos DB
- Elastic Scale : One of the biggest advantage of using any service is elasticity to scale up and down as per need and Azure Cosmos Db is designed to support it. It will be able to deliver the Throughput within 5 seconds at the 99th percentile, from the time of scaling.
- Distributed Application : In the last few years, the type of applications we used to build have changed and now we are looking for globally distributed application which means in the database world is our data will be globally distributed across multiple regions. With this, there comes the bottle neck of consistency as syncing of data is a difficult task and making it consistent. CosmosDb has worked on this pain point and make the data “eventually consistent” which means the data is eventually going to be consistent and the Platform takes care of that you don’t need to handle those scenarios. Microsoft has already taken care of handling these things for you on your behalf by using some best practices.
- Responsive and Critical Application :The system must deliver predictable and guaranteed end-to-end low read and write latencies at the 99th percentile.
- Always on Database : In order to provide the 99.99% availability across multiple regions associated with their database. Azure Cosmos Db gives you a failover mechanism out of the box that means if one region is down than the calls will automatically redirected to the other region and you can also mockup this scenario to test the failover-availability scenario.
- Economical : Microsoft has make sure that the solution of Cosmos Db don’t dig a hole in the pocket of the customers. CosmosDb is very economical and we are going to discuss the pricing model later in this post.
- SchemaLess : Maintaining and designing the schema is a pain point for all the developers so CosmosDB is designed on NoSQL which mean there will be no schema and developers can focus on the application logic instead.
- Support multiple languages and APIs : It supports multiple APIs and language. Microsoft has released SDKs for major programming languages like .Net, .Net Core, Node.js, python, JavaScript and java but also gives the mongo Db user to directly move the data by just changing an API connection string.
Pricing
The data is stored in a SSD and its charged as $0.025 GB/Month. The throughput of the collection is billed per hour and charged at $5.952/Month (based on 744 hours per month). Minimum throughput required is 400 so the minimum cost of a cosmosdb account is going to be somewhere around ~$21 per month. Also, Gremlin is in preview right now and its free as of now.
Summary
Azure CosmosDb is a Globally Distributed, Highly Scalable, highly available fully managed one stop solution for NoSql Customers. It supports REST Based APIs calls and Microsoft has also built client side sdks for .Net, .Net Core, python, node, javascript and Java. It supports Key Value, Column Based, Mongo Db,SQL (Document DB), and Gremlin (Graph DB) as of now. It’s pricing is economical and you can get started as low as $21 per month as of writing this article.