Introduction to Azure Cosmos Database

Introduction to Azure NoSQL database: Cosmos

A cloud database is a database server built and accessed through a cloud platform that helps to organize, store and manage data within an organization. Cloud computing databases can be traditional SQL or NoSQL databases. In this article, I want to discuss the cloud NO SQL database used in Azure called the Cosmos Database. The word “Cosmos” mean ‘the universe seen as a well-ordered whole”. Which is
quite fitting for the Database in Cloud as it can be stored and accessed in order from anywhere around the globe.

Cosmos Database:

Cosmos DB is a globally distributed, low latency, multi-model database that makes large data storage and management easy. It is a cloud-based NoSQL database offered as a platform as a service from Microsoft Azure launched in May 2017. Since Cosmos DB is a NoSQL database, it generally conforms well with how data is used by your application.

How is it different:
Although Azure offers a choice of fully managed relational, No SQL, and in-memory databases. The cosmos DB is designed to support extreme scalability and consistency, targeting the IoT and global-facing cloud applications. The main features which make cosmos DB different than other NoSQL DB are: its pure JSON data types, where an item can be stored in the database as a JSON document and the output of a query is a JSON document as well, the other feature is that a JavaScript engine and query API are built into the database which makes it a proper fit for Microservice architecture. One of the main pros of going for Cosmos DB is it supports multiple languages without the need for complex ORM layers and provides multiple alternative database APIs that can help with migration and
it uses Multi-model which can store data in key-value pairs, documents-based, and graph-based databases.

Supports API endpoints:

A few of the main features of Cosmos DB are its API endpoint choice and unlimited DB size with minimum configuration which is offered by Microsoft to differentiate it from others. It enables to implement same storage engine for each API. It can support Key-value pairs of Table API, Document of Mongo API, Graphs of Gremlin API, Columnar Cassandra API, and document DB of SQL API. Which makes it easy for the developers to implement it without changing the code. It automatically indexes all the data stored as a document DB.

Cosmos DB implementation methods:
The cosmos DB can be provisioned on two levels, Database and container.

Provisioning CDB through Container: In this method, it will use the dedicated capacity and other resources cannot use this dedicated capacity. It can be useful for a multitenant application where each user can be represented by a distinct Azure Cosmos container.

Provisioning CBD through Database: In this method, no physical partition for any container is allocated, instead it is shared between all the containers in the DB. Although, it benefits in terms of cost in long term. The other resources might wait up for the resources to be available, which can max-out the throughput consumption.