Azure Cosmos DB models and APIs
As mentioned earlier, Azure Cosmos DB offers six different database models, all sharing the same infrastructure and concepts. This is a great feature that makes this service flexible and able to serve multiple different purposes. In this section, I will briefly describe each database model so that you will be able to select one that best serves your purposes.
SQL
If you think about SQL, you probably see a relational database with tables, relations, and stored procedures. When working with the SQL API in Cosmos DB, in fact, you will work with documents that can be queried using the SQL syntax. Let's assume you want to query documents using the following call:
SELECT * FROM dbo.Order O WHERE O.AccountNumber = "0000-12-223-12"
Here, you can find an example of a query written in C#:
// using Microsoft.Azure.Documents.Client; // client is DocumentClient class var order = client.CreateDocumentQuery<Order>(collectionLink...