Blog Post

Cloud-Watch - Cosmos DB

by: Simon Hughes
date: Thursday, Sep 12, 2019
category: cloud-watch azure cosmosdb nosql

Cosmos DB was launched on Azure in May 2017 as a global scale multi-model database service for managing data at epic sacle. Its a schemaless, horizontally scaleable, NoSQL database.

Since launch it has grown capabilities to support many interfaces compatible with other NoSQL DBs. Lets take a deeper look.

Graph

Before we start looking at the interface options, lets do a recap on the core benefits of the Azure Cosmos DB.

High Availability is always a challenge with relational databases and often requires replicated SAN storage ot other very expensive hardware solutions. Cosmos DB provides a 99.999% availability solution across both reads and writes. It is quick and easy to configure which regions your Cosmos DB runs in and is designed to be resilient even in the event of complete regional disaster.

As a NoSQL DB it is designed to support schemaless data which removes the pain normally associated with trying to keep a databse schema and indexes in-sync with the application code.

Azure Cosmos DB is supported in all Azure regions worldwide so supporting data close to any worldwide consumers is simple.

Most interesting of all is the APIs which are supported on top of the Azure Cosmos DB. Cosmos DB supports the following APIs

  • SQL API
  • MongoDB API
  • Cassandra API
  • Gremlin API
  • Table API

When creating a Cosmos DB in the Portal or via any of the scripted interfaces you need to select the use-case for your database which will in turn dictate the APIs which are available. Cosmos DB supports the following services, key/value store, document database, and graph databases, which covers off all the main use-cases for NoSQL database.

Using the SQL API you can work with Cosmos in a SQL way, create relational items and query using a SQL like syntax. This model will allow you to quickly and easily move a traditional SQL databse into the Azure cloud and benefit from the Platform as a Service model very efficiently. This does have many limitations and is nowhere near as feature rich as a traditional SQL database, or some of the alternatives below, but is a nice half-way house between relational SQL and NoSQL.

The MongoDB API allows you to simply migrate from an existing MongoDB to a Azure PaaS offering without having to change any code. MongoDB is a fantastic object store and has many uses, but can sometimes be a challenge to manage yourself and commercial support is sometimes an issues. Moving to an Azure PaaS offering on Cosmos gives a quick and simple migration and takes away the pain of supporting MongoDB.

Apache Cassandra is an open source NoSQL databse which is designed to scale across commodity hardware to provide high availability without any single point of failure. Cassandra supports its own query language and is a fantastic solution but has its complexities and does bring challenges to an organisition. Supporting the Cassandra API on top of Cosmos allows you to embrace the Cassandara API without having the hassle and complexity, or support all the infrastructure required.

Gremlin is a Graph database and brings a very different view of the world to database. Based on the princicle of edges and vertices its fantastic at modelling relationships which can be tough to deal with in a relational store, or in any other NoSQL database. Consider the typical Social Media challenges of users, follow other users, have shared interests, common locations, etc. The Gremlin API is optimised to allow queries along the lines of find friends of friends of Simon who share the common interests of Paddleboarding, and Golf in the SW of England.

And finally the Table API supports the regular NoSQL object key/value store.

From this brief overview you hopefully can see all the options available within Cosmos DB and if you are looking at building cloud native applications it really deserves a lot of attention before considering any other databse solutions.

To find out how I can help you, feel free to contact me, pick up the phone or drop me an email.

Related Blog Posts

Cloud-Watch - Azure Databases

Within the Azure platform it is possible to run almost any database platform available. But what if you want to embrace serverless on the Azure platform, and let Microsoft run everything for you. Lets explore the options that are available.

Read More

Cloud-Watch - Serverless

Following on from the post about all the vendors in the cloud space, this time I thought I should focus on serverless. Generally all cloud vendors support 2 different options, specifically Infrastructure as a Service (IaaS) and Platform as a Service (PaaS). Serverless is essentially the new PaaS. So what is serverless?

Read More

Cloud-Watch - Cloud Vendors

For the first in the Cloud Watch series, I thought i would share a quick summary of the major cloud vendors at the moment, and highlight their key technologies and strengths. This is something I work through with each of my clients when I onboard then, to ensure we are building our platforms in the right place. There is no default answer here, every business needs to be evaluated based on its requirements.

Read More