Describe Azure Cosmos DB APIs
While navigating the digital realm, developers often grapple with the challenge of accommo-dating diverse data structures. What if there were a tool that could converse fluently with vary-ing data types, all while maintaining the robustness and scalability that modern applications demand? Enter Azure Cosmos DB and its wide array of APIs.
Azure Cosmos isn’t just your average database service. Its unique selling point is its mul-timodel capability, allowing you to interact with data in several formats, from document to columnar to graph. At the heart of this versatility are the APIs that Azure Cosmos DB sup-ports. These APIs empower you to harness different data models seamlessly and tailor the database to your application’s needs rather than forcing your application to fit a specific database mold.
In the sections to come, you’ll embark on a journey through these APIs, understanding their intricacies, benefits, and real-world applications. Whether you’re molding JSON documents, migrating from MongoDB, or diving into the interconnected world of graph databases, there’s an API tailored just for you.
Get ready to dive into this powerful facet of Azure Cosmos DB, unraveling its potential to revolutionize the way you perceive and interact with databases.
Core (SQL) API
At its heart, Azure Cosmos DB started with its native API, designed primarily for semi-structured JSON documents. This API fuses the NoSQL world with familiar SQL querying capabilities, granting developers the flexibility of JSON with the familiarity of SQL operations.
These are its advantages:
■■ Flexibility: Easily manage and query JSON documents.
■■ Familiar syntax: Utilize SQL-like queries to manage your data.
Suppose you have a collection of articles stored as JSON documents, as shown in Figure 3-11.

FIGURE 3-11 Article stored as a JSON document
Figure 3-12 shows the SQL-like query you use to retrieve all the articles by Jane Doe.

FIGURE 3-12 SQL-like query to retrieve articles
90 CHAPTER 3 Describe considerations for working with non-relational data on Azure
Leave a Reply