NameMicrosoft Azure Cosmos DB  Microsoft Azure SQL Database  
DescriptionGlobally distributed, horizontally scalable, multi-model database serviceDatabase as a Service offering with high compatibility to Microsoft SQL Server
Primary database modelDocument store
Graph DBMS
Key-value store
Wide column store
Relational DBMS
Secondary database modelsDocument store
Graph DBMS
Websiteazure.microsoft.com/­services/­cosmos-dbazure.microsoft.com/­en-us/­services/­sql-database
Technical documentationdocs.microsoft.com/­en-us/­azure/­cosmos-dbdocs.microsoft.com/­en-us/­azure/­sql-database
DeveloperMicrosoftMicrosoft
Initial release20142010
Current releaseV12
License commercialcommercial
Cloud-based only yesyes
DBaaS offerings (sponsored links) 
Server operating systemshostedhosted
Data schemeschema-freeyes
Typing yes yes
XML support yes
Secondary indexesyes yes
SQL SQL-like query languageyes
APIs and other access methodsDocumentDB API
Graph API (Gremlin)
MongoDB API
RESTful HTTP API
Table API
JDBC
ODBC
ADO.NET
Server-side scripts JavaScriptTransact SQL
TriggersJavaScriptyes
Partitioning methods Sharding 
Replication methods yes yes, with always 3 replicas available
MapReduce with Hadoop integration no
Consistency concepts Bounded Staleness
Consistent Prefix
Session Consistency
Eventual Consistency
Immediate Consistency 
Immediate Consistency
Foreign keys noyes
Transaction concepts Multi-item ACID transactions with snapshot isolation within a partitionACID
Concurrency yesyes
Durability yesyes
User concepts Access rights can be defined down to the item levelfine grained access rights according to SQL-standard

Cosmos DB is a globally distributed, multi-model database solution with high SLAs around distribution. It’s designed for your applications and supports document and graph databases. Azure SQL DB has the concept of consistent reads and the ability to store your data. But my goal here is to talk about their differences with global replication and global distribution of your data.

Cosmos DB

  • When it comes to distributing, with Cosmos DB you get a primary instance to write against and it gets distributed to all your read-only replicas that you choose around the world.
  • You can simply push a button, activate new scenarios and you can run manual failover transactions.
  • The big key with Cosmos is that is was built for global distribution. It was designed with the controls that allow it to be globally distributed with SLAs associated with that global distribution.
  • Another key thing is that you get one URL and that URL knows where to go and does all the work.

Azure SQL Database

  • Makes it possible to globally distribute your Azure SQL Databases.
  • You can have a primary replica that stands in the US and add secondary read-only replicas in Europe and Asia for instance. You can have the read closer to the people who are using your global applications.

A couple things to be aware of, with Azure SQL DB you only have 4 read-only secondaries off an individual or SQL DB. In contrast, Cosmos DB can replicate wherever Cosmos DB is in the data center; you just go in and click a button. Also, in Cosmos you can do manual failover operations, or you can code them out, so it can be written to wherever it is in the world, closer to the active people using your application.

Do you need the ability of global distribution of your data and wonder which database is the best for this? Today, I’d like to give you a comparison between Azure SQL Database and Cosmos Database for global distribution.

Cosmos DB is a globally distributed, multi-model database solution with high SLAs around distribution. It’s designed for your applications and supports document and graph databases. Azure SQL DB has the concept of consistent reads and the ability to store your data. But my goal here is to talk about their differences with global replication and global distribution of your data.

Cosmos DB

  • When it comes to distributing, with Cosmos DB you get a primary instance to write against and it gets distributed to all your read-only replicas that you choose around the world.
  • You can simply push a button, activate new scenarios and you can run manual failover transactions.
  • The big key with Cosmos is that is was built for global distribution. It was designed with the controls that allow it to be globally distributed with SLAs associated with that global distribution.
  • Another key thing is that you get one URL and that URL knows where to go and does all the work.

Azure SQL Database

  • Makes it possible to globally distribute your Azure SQL Databases.
  • You can have a primary replica that stands in the US and add secondary read-only replicas in Europe and Asia for instance. You can have the read closer to the people who are using your global applications.

A couple things to be aware of, with Azure SQL DB you only have 4 read-only secondaries off an individual or SQL DB. In contrast, Cosmos DB can replicate wherever Cosmos DB is in the data center; you just go in and click a button. Also, in Cosmos you can do manual failover operations, or you can code them out, so it can be written to wherever it is in the world, closer to the active people using your application.

Manual failover is not something you would do with Azure SQL DB. All those writes must come to a primary replica and we’d have to feed out the replicas through read. The biggest pain point you may notice is managing the connectivity to your Azure SQL database in a globally replicated scenario.

There are some techniques, as well as tools within Azure to make it easier to use, such as Traffic Manager. You have the option to use an IP address in Traffic Manager and route things through there, but you must set all that up.

With Cosmos DB, that work is done for you because it’s designed from the ground up to be globally replicated. This does not mean you shouldn’t use active global replication with Azure SQL DB. You just need to understand the differences and use cases to make sure you use the database that best fits your needs to distribute your data globally.

Compare the most common: Amazon DynamoDB, Azure Cosmos DB and Mongo DB

NameAmazon DynamoDBMicrosoft Azure Cosmos DB MongoDB 
DescriptionHosted, scalable database service by Amazon with the data stored in Amazons cloudGlobally distributed, horizontally scalable, multi-model database serviceOne of the most popular document stores
Primary database modelDocument store
Key-value store
Document store
Graph DBMS
Key-value store
Wide column store
Document store
Websiteaws.amazon.com/­dynamodbazure.microsoft.com/­services/­cosmos-dbwww.mongodb.com
Technical documentationdocs.aws.amazon.com/­dynamodbdocs.microsoft.com/­en-us/­azure/­cosmos-dbdocs.mongodb.com/­manual
DeveloperAmazonMicrosoftMongoDB, Inc
Initial release201220142009
License commercial commercialOpen Source 
Cloud-based only yesyesno 
Server operating systemshostedhostedLinux
OS X
Solaris
Windows
Data schemeschema-freeschema-freeschema-free 
Typing yesyes yes 
Secondary indexesyesyes yes
SQL noSQL-like query languageRead-only SQL queries via the MongoDB Connector for BI
APIs and other access methodsRESTful HTTP APIDocumentDB API
Graph API (Gremlin)
MongoDB API
RESTful HTTP API
Table API
proprietary protocol using JSON
Server-side scripts noJavaScriptJavaScript
Triggersyes JavaScriptno
Partitioning methods ShardingSharding Sharding
Replication methods yesyes Master-slave replication
MapReduce no with Hadoop integration yes
Consistency concepts Eventual Consistency
Immediate Consistency 
Bounded Staleness
Consistent Prefix
Session Consistency
Eventual Consistency
Immediate Consistency 
Eventual Consistency
Immediate Consistency 
Foreign keys nonono 
Transaction concepts ACID Multi-item ACID transactions with snapshot isolation within a partitionMulti-document ACID Transactions with snapshot isolation
Concurrency yesyesyes
Durability yesyesyes 
In-memory capabilities yes 
User concepts Access rights for users and roles can be defined via the AWS Identity and Access Management (IAM)Access rights can be defined down to the item levelAccess rights for users and roles