Technology Fridays: Cosmos DB Wants to be the Only Database You Will Ever Need
Welcome to Technology Fridays! I don’t often write about databases because I try to focus this segment on innovative technologies in emerging technical markets. Even though we can argue that we are in the golden age of databases, it is hard to find database technologies that are completely different from anything we’ve seen before. Today, I would like to explore a new database platform that is literally redefining some of the traditional concepts in the industry.
Azure Cosmos DB is the latest addition to the data storage services portfolio of the Microsoft cloud platform. Cosmos DB challenges some of the conventional wisdoms in database technologies by supporting multiple data models on a single runtime. Almost since their inception, database platforms have been designed for a specific data model such as relational, document, graph key-value pairs and others. However, modern application architectures such as mobile or the internet of things(IOT) increasingly demand multiple data models. That’s the promise of Cosmos DB. One database to rule them all ;) Ok, maybe not but you get the idea :).
Azure Cosmos DB is a multi-modal database platform that natively supports various data models such as document, graph, key-value, table, columnar and several others. The platforms supports all those data models using a consistent infrastructure, toolset and architectures which enables developers to switch from one mode to another without having to learn a new runtime. More importantly, Cosmos DB is compatible with industry protocols which guarantees interoperability with mainstream database runtimes such as MongoDB or Neo4J.
A multi-modal database is a nice concept but its incredibly hard to achieve. If you think about it, every database runtime uses an underlying data structure optimized for its specific data model. For instance, B-Trees have long been the data structure behind relational databases just like HDFS is the underlying data structure behind platforms such as Hive or HBase. Cosmos DB relies on a structure called atom-record-sequence(ARS) which was designed from the ground up to support different data models without sacrificing performance or scalability.
In order to use Cosmos DB, developers can leverage the different APIs available with the platform including DocumentDB and MongoDB for document structures, Greemlin for graphs, Table API for columnar storage and others. Instead of inventing a new API and query language, Cosmos DB relies on industry accepted protocols which guarantees interoperability and portability with other database runtimes.
The multi-modal capabilities of Cosmos DB expand beyond the programming model and include different aspects of its infrastructure. The platform supports different consistency models ranging from robust SQL-like consistency to NOSQL-like eventually consistent paradigms. Similarly, Cosmos DB is able to scale across different Azure regions and handle massive amounts of read and write operations maintaining a very low latency. Cosmos DB seamlessly interoperates with other Azure services such as Azure Functions which can be used to enabled sophisticated server-side logic.
Azure Cosmos DB is one of the first multi-modal cloud platforms in the market and doesn’t have many direct competitors. However, technologies such as AWS DynamoDB and the recently announced Neptune or MongoDB Atlas do a phenomenal job supporting different data models and, in the future, can become relevant competitors of Cosmos DB.