Tag: Azure Cosmos DB

Practice Questions: Describe Azure Cosmos DB APIs (DP-900 Exam Prep)

Practice Questions


Question 1

Which API in Azure Cosmos DB uses a SQL-like query language?

A. Gremlin API
B. Cassandra API
C. Core (SQL) API
D. Table API

Answer: C

Explanation:
The Core (SQL) API uses a SQL-like syntax to query JSON documents.


Question 2

Which Azure Cosmos DB API is BEST suited for applications currently using MongoDB?

A. Core (SQL) API
B. MongoDB API
C. Cassandra API
D. Table API

Answer: B

Explanation:
The MongoDB API provides compatibility with MongoDB drivers and queries.


Question 3

Which API should you choose for graph-based data and relationships?

A. Table API
B. Cassandra API
C. Gremlin API
D. MongoDB API

Answer: C

Explanation:
The Gremlin API is designed for graph data models and relationship analysis.


Question 4

Which API in Cosmos DB is most similar to Azure Table Storage?

A. MongoDB API
B. Cassandra API
C. Table API
D. Core (SQL) API

Answer: C

Explanation:
The Table API uses a key-value model similar to Azure Table Storage.


Question 5

Which statement about Azure Cosmos DB APIs is TRUE?

A. You can switch APIs after creating the account
B. Each API uses a different query language and data model
C. All APIs use T-SQL
D. APIs determine storage redundancy

Answer: B

Explanation:
Each API has its own data model and query language.


Question 6

Which API would you choose for a distributed system currently using Apache Cassandra?

A. Core (SQL) API
B. MongoDB API
C. Cassandra API
D. Gremlin API

Answer: C

Explanation:
The Cassandra API supports Cassandra Query Language (CQL) and workloads.


Question 7

Which API is the default and most commonly used in Azure Cosmos DB?

A. Table API
B. Gremlin API
C. Core (SQL) API
D. Cassandra API

Answer: C

Explanation:
The Core (SQL) API is the most commonly used and general-purpose API.


Question 8

Which scenario is BEST suited for the Table API?

A. Complex graph traversal
B. Large-scale relational queries
C. Simple key-value data storage
D. Document-based analytics

Answer: C

Explanation:
The Table API is ideal for simple, scalable key-value storage.


Question 9

What is a key consideration when choosing a Cosmos DB API?

A. The size of the storage account
B. The number of virtual machines
C. The application’s existing data model and query language
D. The type of Azure subscription

Answer: C

Explanation:
API selection depends on existing technologies and data models.


Question 10

Which statement best describes Azure Cosmos DB APIs?

A. Each API uses a different underlying database engine
B. APIs provide different ways to interact with the same service
C. APIs are only used for relational data
D. APIs determine the pricing tier only

Answer: B

Explanation:
All APIs use the same Cosmos DB service but offer different interfaces and models.


✅ Quick Exam Takeaways

✔ Cosmos DB APIs allow different ways to interact with the same service

✔ APIs:

  • Core (SQL) → SQL-like queries (most common)
  • MongoDB → MongoDB compatibility
  • Cassandra → Distributed systems (CQL)
  • Table → Key-value storage
  • Gremlin → Graph data

✔ Key concepts:

  • API choice depends on data model and existing system
  • API selection is permanent after creation

✔ Exam tip:
👉 Match data model → API type


Go to the DP-900 Exam Prep Hub main page.

Describe Azure Cosmos DB APIs (DP-900 Exam Prep)

This post is a part of the DP-900: Microsoft Azure Data Fundamentals Exam Prep Hub. 
This topic falls under these sections:
Describe considerations for working with non-relational data on Azure (15–20%)
--> Describe Capabilities and Features of Azure Cosmos DB
--> Describe Azure Cosmos DB APIs


Note that there are 10 practice questions (with answers and explanations) for each section to help you solidify your knowledge of the material. Also, there are 2 practice tests with 60 questions each available on the hub below the exam topics section.

Azure Cosmos DB supports multiple APIs that allow developers to interact with the database using different data models and familiar query languages.

For the DP-900 exam, you should understand what these APIs are, how they differ, and when to use each one.


What Are Azure Cosmos DB APIs?

APIs in Azure Cosmos DB define:

  • How data is structured
  • How it is queried
  • Which tools and SDKs are used

✔ Each API provides a different way to interact with the same underlying Cosmos DB service.


Why Multiple APIs?

Azure Cosmos DB supports multiple APIs to:

  • Allow developers to use familiar tools
  • Enable easy migration from existing systems
  • Support different types of applications and data models

💡 Key idea:
👉 Choose the API based on your application’s existing technology or data model


Core Azure Cosmos DB APIs


1. Core (SQL) API

Also known as the SQL API.

Key Features

  • Uses a SQL-like query language
  • Stores data as JSON documents
  • Most commonly used API

Use Cases

  • New application development
  • General-purpose NoSQL workloads

Best for: Developers familiar with SQL who want flexibility


2. MongoDB API

Key Features

  • Compatible with MongoDB drivers and tools
  • Uses MongoDB query syntax

Use Cases

  • Migrating existing MongoDB applications
  • Applications already using MongoDB

Best for: MongoDB workloads moving to Azure


3. Cassandra API

Key Features

  • Compatible with Apache Cassandra
  • Supports Cassandra Query Language (CQL)

Use Cases

  • Large-scale distributed workloads
  • Applications using Cassandra

Best for: Cassandra-based systems needing cloud scalability


4. Table API

Key Features

  • Similar to Azure Table Storage
  • Key-value data model
  • Uses OData-based queries

Use Cases

  • Simple key-value workloads
  • Applications already using Table Storage

Best for: Lightweight, scalable key-value scenarios


5. Gremlin API

Key Features

  • Supports graph data models
  • Uses Gremlin query language

Use Cases

  • Graph-based applications
  • Relationship-heavy data

Best for: Social networks, recommendation engines, network analysis


Key Differences Between APIs

APIData ModelQuery LanguageBest For
Core (SQL)Document (JSON)SQL-likeGeneral-purpose apps
MongoDBDocumentMongoDB queryMongoDB migration
CassandraWide-columnCQLDistributed systems
TableKey-valueODataSimple scalable storage
GremlinGraphGremlinRelationship-based data

Important Concepts for DP-900


1. Same Service, Different Interfaces

All APIs run on Azure Cosmos DB, but:

  • Each API has its own endpoint
  • Each uses different query syntax
  • Each supports different SDKs

2. API Choice Is Permanent

  • You choose the API when creating a Cosmos DB account
  • You cannot switch APIs later

3. Performance and Features Are Shared

  • Global distribution
  • Low latency
  • High availability
  • Scalability

✔ These benefits apply regardless of API choice.


When to Choose Each API

  • Core (SQL) API → Default choice for most applications
  • MongoDB API → Existing MongoDB apps
  • Cassandra API → Distributed, large-scale systems
  • Table API → Simple key-value workloads
  • Gremlin API → Graph relationships

Why This Matters for DP-900

On the exam, you may be asked to:

  • Identify the correct API for a scenario
  • Match APIs to data models
  • Understand why multiple APIs exist
  • Recognize migration scenarios

Summary — Exam-Relevant Takeaways

✔ Azure Cosmos DB supports multiple APIs:

  • Core (SQL) API
  • MongoDB API
  • Cassandra API
  • Table API
  • Gremlin API

✔ Each API:

  • Uses a different data model
  • Has its own query language

✔ Key concept:
👉 Choose the API based on your application’s needs or existing system

✔ Important:

  • API choice is fixed at creation
  • All APIs benefit from Cosmos DB features (scalability, global distribution)

Go to the Practice Exam Questions for this topic.

Go to the DP-900 Exam Prep Hub main page.

Identify use cases for Azure Cosmos DB (DP-900 Exam Prep)

This post is a part of the DP-900: Microsoft Azure Data Fundamentals Exam Prep Hub. 
This topic falls under these sections:
Describe considerations for working with non-relational data on Azure (15–20%)
--> Describe capabilities and features of Azure Cosmos DB
--> Identify use cases for Azure Cosmos DB


Note that there are 10 practice questions (with answers and explanations) for each section to help you solidify your knowledge of the material. Also, there are 2 practice tests with 60 questions each available on the hub below the exam topics section.

Azure Cosmos DB is a fully managed, globally distributed database service designed for modern applications that require low latency, massive scalability, and flexible data models.

For the DP-900 exam, you should understand when and why to use Azure Cosmos DB, especially compared to other Azure storage and database services.


What Is Azure Cosmos DB?

Azure Cosmos DB is a NoSQL, multi-model database service that supports:

  • Global distribution across multiple regions
  • Low-latency reads and writes
  • Automatic scaling
  • Multiple APIs (Core SQL, MongoDB, Cassandra, Table, Gremlin)

✔ It is designed for high-performance, internet-scale applications.


Key Characteristics That Drive Use Cases

Understanding Cosmos DB use cases starts with its capabilities:

1. Global Distribution

  • Replicate data across multiple Azure regions
  • Users access data from the closest region

✔ Enables global applications with low latency


2. Low Latency

  • Single-digit millisecond response times
  • Ideal for real-time applications

3. Massive Scalability

  • Scales throughput and storage independently
  • Handles millions of requests per second

4. Flexible Schema

  • Schema-less (JSON-based data model)
  • Supports evolving application requirements

5. Multiple APIs

  • Supports different data models:
    • SQL (Core API)
    • MongoDB
    • Cassandra
    • Table
    • Gremlin (graph)

✔ Allows developers to use familiar tools and frameworks


Common Use Cases for Azure Cosmos DB


1. Global Web and Mobile Applications

Scenario

Applications with users distributed worldwide.

Why Cosmos DB?

  • Global distribution
  • Low latency access
  • High availability

✔ Example:

  • Social media platforms
  • E-commerce applications

2. Real-Time Personalization

Scenario

Applications that tailor content to users instantly.

Why Cosmos DB?

  • Fast read/write performance
  • Flexible schema

✔ Example:

  • Product recommendations
  • Personalized dashboards

3. IoT and Telemetry Data

Scenario

Large volumes of streaming data from devices.

Why Cosmos DB?

  • High ingestion rates
  • Scalable storage
  • Schema flexibility

✔ Example:

  • Sensor data collection
  • Smart devices

4. Gaming Applications

Scenario

Online games requiring real-time interactions.

Why Cosmos DB?

  • Low latency
  • Global availability
  • High throughput

✔ Example:

  • Leaderboards
  • Player profiles
  • Game state storage

5. E-commerce Platforms

Scenario

High-traffic applications with variable workloads.

Why Cosmos DB?

  • Elastic scalability
  • Fast performance
  • Global distribution

✔ Example:

  • Shopping carts
  • Product catalogs

6. Content Management Systems

Scenario

Managing diverse and evolving content.

Why Cosmos DB?

  • Schema-less design
  • Flexible data models

✔ Example:

  • Blogs
  • Media platforms

7. Event-Driven and Microservices Architectures

Scenario

Modern distributed applications.

Why Cosmos DB?

  • Scales independently per service
  • Supports high-throughput operations

✔ Example:

  • Microservices storing independent datasets

When NOT to Use Azure Cosmos DB

Cosmos DB is not ideal when:

  • You need complex joins and relational queries
  • You require strict relational consistency across multiple tables
  • Your workload is small and cost-sensitive

✔ In these cases, relational databases like Azure SQL may be more appropriate.


Cosmos DB vs Other Azure Storage Options

ServiceBest For
Blob StorageUnstructured files (images, videos)
Azure FilesFile shares
Table StorageSimple key-value storage
Cosmos DBGlobal, high-performance NoSQL apps

Why This Matters for DP-900

On the exam, you may be asked to:

  • Identify appropriate Cosmos DB use cases
  • Choose Cosmos DB for global, low-latency applications
  • Compare it with other Azure storage services
  • Recognize scenarios requiring scalability and flexibility

Summary — Exam-Relevant Takeaways

✔ Azure Cosmos DB = globally distributed NoSQL database

✔ Key strengths:

  • Low latency
  • Global distribution
  • Massive scalability
  • Flexible schema

✔ Common use cases:

  • Global apps
  • Real-time personalization
  • IoT and telemetry
  • Gaming
  • E-commerce

✔ Not suitable for:

  • Complex relational workloads
  • Heavy join operations

✔ Key decision factor:
👉 High scale + low latency + global users = Cosmos DB


Go to the Practice Exam Questions for this topic.

Go to the DP-900 Exam Prep Hub main page.

Practice Questions: Identify use cases for Azure Cosmos DB (DP-900 Exam Prep)

Practice Questions


Question 1

Which scenario is BEST suited for Azure Cosmos DB?

A. Running complex SQL joins across multiple tables
B. Storing structured financial transactions with strict relational constraints
C. Supporting a globally distributed mobile application with low latency
D. Hosting a traditional on-premises file share

Answer: C

Explanation:
Cosmos DB is ideal for globally distributed applications requiring low latency.


Question 2

Which type of application benefits MOST from Cosmos DB’s global distribution capabilities?

A. Local desktop application
B. Single-region reporting system
C. Global e-commerce website
D. Batch processing system

Answer: C

Explanation:
Global applications benefit from multi-region replication and low latency.


Question 3

Which use case is BEST suited for Cosmos DB?

A. Data warehouse for historical reporting
B. IoT application collecting real-time sensor data
C. Relational database with complex joins
D. File storage for images

Answer: B

Explanation:
Cosmos DB is optimized for high-ingestion, real-time data scenarios like IoT.


Question 4

Why is Cosmos DB suitable for real-time personalization scenarios?

A. It enforces strict relational schemas
B. It supports high-latency operations
C. It provides low-latency read/write performance
D. It requires predefined schemas

Answer: C

Explanation:
Low latency enables instant updates and responses for personalization.


Question 5

Which application would MOST benefit from Cosmos DB?

A. Payroll system requiring strict ACID compliance across multiple tables
B. Static website hosting images
C. Gaming application storing player state globally
D. Spreadsheet-based reporting system

Answer: C

Explanation:
Gaming apps require low latency, high throughput, and global availability.


Question 6

Which scenario is NOT a good fit for Cosmos DB?

A. Global content management system
B. Real-time analytics dashboard
C. Complex relational reporting with joins
D. Social media application

Answer: C

Explanation:
Cosmos DB is not ideal for complex relational queries or joins.


Question 7

Which feature of Cosmos DB makes it ideal for microservices architectures?

A. Fixed schema design
B. Independent scalability for each service
C. Requirement for relational constraints
D. Limited throughput options

Answer: B

Explanation:
Each microservice can scale independently using Cosmos DB.


Question 8

Which use case involves storing flexible, evolving data structures?

A. Financial ledger system
B. Product catalog with changing attributes
C. Relational reporting system
D. Fixed-schema inventory system

Answer: B

Explanation:
Cosmos DB’s schema-less design supports evolving data models.


Question 9

Which scenario best demonstrates Cosmos DB’s high-throughput capabilities?

A. Processing monthly reports
B. Handling millions of real-time user requests
C. Archiving old documents
D. Storing backup files

Answer: B

Explanation:
Cosmos DB is designed for high-throughput, real-time workloads.


Question 10

Which Azure service would you choose for a globally distributed application requiring millisecond response times?

A. Azure Blob Storage
B. Azure Files
C. Azure Cosmos DB
D. Azure Table Storage

Answer: C

Explanation:
Cosmos DB is specifically designed for low-latency, globally distributed applications.


✅ Quick Exam Takeaways

✔ Cosmos DB = global, low-latency NoSQL database

✔ Best for:

  • Global web/mobile apps
  • IoT and telemetry
  • Gaming
  • Real-time personalization
  • Microservices

✔ Key strengths:

  • Global distribution
  • Massive scalability
  • Flexible schema
  • High throughput

✔ Not ideal for:

  • Complex joins
  • Strict relational workloads

✔ Exam tip:
👉 If you see “global + real-time + high scale” → think Cosmos DB


Go to the DP-900 Exam Prep Hub main page.