Build a Node.js or Java web app for Azure Cosmos DB

Simple Java Web App for Cosmos DB
These two articles for Node.js and Java are tutorials that explores how to use Microsoft Azure Cosmos DB to store and access data from a Node.js Express or Java web application hosted on Azure Websites.

Develop locally with the Azure Cosmos DB Emulator

CosmosDB Emulator
The Azure Cosmos DB Emulator provides a local development environment that emulates the Azure Cosmos DB service. Using this you can develop and test your application locally, without the need for an Azure subscription or incurring any costs. Once development is complete and you are ready, you can switch across to using an Azure Cosmos DB account in the cloud.

This is a handy article which covers the following tasks:

  • Installing the Emulator
  • Running the Emulator on Docker for Windows
  • Authenticating requests
  • Using the Data Explorer in the Emulator
  • Exporting SSL certificates
  • Calling the Emulator from the command line
  • Collecting trace files

There are some limitations to the Emulator, when compared to the highly scalable cloud version, below is an outline of some of the differences…

Azure Cosmos DB Emulator Azure Cosmos DB Cloud Service
Supports only a single fixed account and a well-known master key. Key regeneration is not possible. Supports multiple accounts and different master keys. You can regenerate keys any time from Azure Portal
Non scalable. Highly scalable
Does not support larger data sets. Support for large data sets
Does not simulate consistency levels. Different Consistency levels available
Does not simulate multi-region replication. Configurable as part of the platform, as needed basis
Does not support quota override feature. Supports document size limit increases, increased partitioned collection storage etc.
Will not support most recent changes to Cosmos DB platform. Most recent platform updates are available


Azure Cosmos DB – Lessons learnt from building a globally distributed database from the ground up


In this talk, I describe the key capabilities, system design and various design trade-offs we had to make in the process of building Cosmos DB ( service. I also share our experience from operating a globally distributed database service worldwide and maintaining comprehensive Service Level Agreements (SLAs).