Azure CosmosDB — Lessons learned

Lessons learned developing a NodeJs application on CosmosDB with the MongoDB interface

Julien Kervizic
Hacking Analytics

--

Photo by Jeremy Thomas on Unsplash

CosmosDB is a fully managed, globally distributed database on Azure. It offers different interfaces to connect to the data, be it SQL, MongoDB, Cassandra, Gremlin… These however, need to be set at the time of creation, after which it is only possible to use the database with the selected API.

Mongo Interface

There are two versions of the interface available for Cosmos DB Mongo API, the 3.2 and 3.6 versions.

The 3.2 interface only supports the basic feature of mongo, but these can be enhanced using “3.4” preview features, enabling, for instance, unique index and aggregation. There are some issues with using this version; however, aggregations, for example, are limited to 40Mb of memory.

The 3.6 interface added compound index, fixed the issue of 40MB and enabled autoscaling, provided the change feed as well as enabled the creation of unsharded collection in database with set throughput. Additionally, it provided previews feature for autoscaling throughput and in enabling analytical queries through Spark. Still, the interface doesn’t offer the full range of mongo’s feature, and some features such as multiple join conditions in lookups are…

--

--

Julien Kervizic
Hacking Analytics

Living at the interstice of business, data and technology | Head of Data at iptiQ by SwissRe | previously at Facebook, Amazon | julienkervizic@gmail.com