Comments on CosmosDB

After working with CosmosDB for two years, I thought of writing down a couple of things.

CosmosDB is a multi-model database where one can use three models: relational, document and graph data model. The user needs to select one that will be used, although the storage-engine used underneath is the same for all of them. The problem is that, one model cannot cover the usual requirements.

Graph data model is so much better in modelling the business entities. Multi model databases that include the graph data model should therefore ensure that all of the database features are available primarily through graph interface. In CosmosDB, that is not the case. Graph model doesn't support transactions, spatial queries, case-insensitive text comparison and storing of json documents. These (excluding json documents) are supported in relational model.

One can use many models together at the same time but this is a pain to do because each model requires a separate client and separate connection to the same CosmosDB instance. It is probably not intended to use other than the selected model. On top of that, different models store the entities differently which needs to be taken into account when querying it with different models.

My understanding is that Microsoft wanted to quickly provide a multi-model database in Azure but after so many years since it was released they did went much further (regarding the things I wrote above).

CosmosDB graph Browser in Azure is a story on its own - it is terrible:

  • Toolbars and action/info panels on all sides take way too much space where the actual main content, the graph display panel, takes only a small portion of the webpage. Some panels can be collapsed which does enlarge the graph panel.
  • It is not usable if one wants to browse the data structure. It takes way too much effort. Also, the number of related vertices shown is limited to 10 and paging makes browsing through relations terrible.
  • The Webpage is often showing four scrollbars on the right side one next to another, each scrolling a different section of a page. One needs to constantly change positions of different scrollbars to get the work done which is very annoying.
  • Gremlin query field displays the history in a drop-down which often doesn't hide when one clicks outside of it. With a long history the graph display panel is moved under it and one needs to scroll up and down even more.
  • Webpage looks like it was designed by a teenager making the first website in his life. Even components used to build the website work funny - like the tab component that focuses itself when the mouse is simply moved over it for no apparent reason.

Graph data model should, I firmly believe, be the facto standard used in (almost) all business applications. Except of course for those that work with tabular data. Ironically, relational databases should not be used for relational data, only tabular ones. Storing business entities and their relations in a graph database is so much better. I therefore wonder why CosmosDB supports SQL interface. In my opinion should CosmosDB be a mix of graph and document database only, with one query language.

To view or add a comment, sign in

More articles by Tomaz Koritnik

Explore content categories