Extra considerations
Now that we know how to design a Cosmos DB database (whether it's a document database or a key-value database), let's take some time to consider whether to use Azure SQL Database or Azure Cosmos DB. We didn't start this chapter with a discussion of big data and the four Vs for nothing! The JSON storage of Cosmos DB gives a lot of flexibility that comes in very handy when dealing with variability. The cluster technology and the fact that you can easily create copies of a Cosmos DB database around the globe provide enormous scalability possibilities.
At the same time, it should be noted that Azure SQL Database can scale up to many terabytes, can handle XML and JSON data, has node and edge tables to do graph database queries, and can create read-only replicas around the globe. Azure SQL Database is known and proven technology with more functionality inside the database itself. SQL databases are also very much capable of optimizing queries by taking...