AZ-200 Azure Cosmos DB 1 — Questions and Answers
Question 1: What is the significance of the partition key in Azure Cosmos DB?
- It determines the geographic region where data is stored
- It distributes data across logical partitions to enable horizontal scaling (Correct answer)
- It encrypts data at rest
- It defines the indexing policy
Correct answer: It distributes data across logical partitions to enable horizontal scaling
The partition key determines how data is distributed across logical partitions, enabling Cosmos DB to scale horizontally and process queries efficiently.
Question 2: Which consistency level in Azure Cosmos DB guarantees that reads always return the most recently written value?
- Session
- Bounded Staleness
- Strong (Correct answer)
- Consistent Prefix
Correct answer: Strong
Strong consistency guarantees that reads always reflect the latest committed write, providing linearizability at the cost of higher latency.
Question 3: What unit does Azure Cosmos DB use to measure and limit database operation throughput?
- DTUs (Database Transaction Units)
- RUs (Request Units) (Correct answer)
- ACUs (Azure Compute Units)
- IOPs
Correct answer: RUs (Request Units)
Request Units (RUs) are the currency for throughput in Cosmos DB; every operation consumes RUs based on complexity, size, and consistency level.
Question 4: Which Cosmos DB API is most appropriate for migrating an existing MongoDB application to Azure?
- SQL (Core) API
- Cassandra API
- MongoDB API (Correct answer)
- Table API
Correct answer: MongoDB API
The Azure Cosmos DB for MongoDB API is wire-protocol compatible with MongoDB, allowing existing MongoDB applications to connect with minimal code changes.
Question 5: What is the purpose of the Time to Live (TTL) feature in Azure Cosmos DB?
- Limits query execution time
- Automatically deletes items after a specified number of seconds (Correct answer)
- Controls session token expiry
- Sets the maximum RU burst duration
Correct answer: Automatically deletes items after a specified number of seconds
TTL automatically deletes documents after a configured number of seconds, enabling automatic data expiration without consuming RUs for manual deletes.
Question 6: What is the purpose of a stored procedure in Azure Cosmos DB?
- To schedule background jobs
- To execute atomic, transactional operations on items within a single partition (Correct answer)
- To replicate data to other regions
- To create secondary indexes
Correct answer: To execute atomic, transactional operations on items within a single partition
Stored procedures in Cosmos DB run server-side JavaScript and execute atomically within a single logical partition, supporting ACID transactions.
What is the significance of the partition key in Azure Cosmos DB?