AZ-200 Azure Cosmos DB 2 — Questions and Answers
Question 1: How does Azure Cosmos DB multi-region write (multi-master) benefit applications?
- Reduces storage costs by compressing data across regions
- Allows writes to any configured region, reducing write latency globally (Correct answer)
- Enables single-region strong consistency
- Removes the need for partition keys
Correct answer: Allows writes to any configured region, reducing write latency globally
Multi-region writes allow applications to write to the nearest configured region, drastically reducing write latency for globally distributed users.
Question 2: Which Cosmos DB feature streams all insert, update, and delete operations to downstream consumers in real time?
- Cosmos DB Triggers via Logic Apps
- Change Feed (Correct answer)
- Event Grid integration
- Azure Data Factory pipeline
Correct answer: Change Feed
Change Feed provides a sorted, persistent log of all changes (inserts and updates) in a Cosmos DB container, enabling real-time event-driven processing.
Question 3: What happens if a Cosmos DB operation exceeds the provisioned RU/s limit on a container?
- The operation fails permanently and must be retried manually
- Cosmos DB returns a 429 Too Many Requests response and the SDK retries automatically (Correct answer)
- The container auto-scales to unlimited RUs
- Data is queued and processed later
Correct answer: Cosmos DB returns a 429 Too Many Requests response and the SDK retries automatically
Exceeding provisioned throughput causes Cosmos DB to return HTTP 429, and the SDK's built-in retry policies handle automatic back-off and retry.
Question 4: Which Cosmos DB indexing mode indexes every item and property by default?
- Lazy
- None
- Consistent (Correct answer)
- Partial
Correct answer: Consistent
The Consistent indexing mode synchronously updates the index after every write, ensuring queries always reflect the latest data by default.
Question 5: What is the purpose of using a synthetic partition key in Azure Cosmos DB?
- To encrypt items at rest
- To combine multiple properties into a single high-cardinality partition key (Correct answer)
- To replicate data to secondary regions
- To reduce RU consumption on reads
Correct answer: To combine multiple properties into a single high-cardinality partition key
A synthetic partition key concatenates or hashes multiple fields to create a high-cardinality key, ensuring even data distribution across partitions.
Question 6: Which Cosmos DB SDK method is used to perform an efficient point read by specifying both the item ID and partition key?
- container.QueryItemsAsync()
- container.ReadItemAsync(id, partitionKey) (Correct answer)
- container.GetItemQueryIterator()
- container.UpsertItemAsync()
Correct answer: container.ReadItemAsync(id, partitionKey)
ReadItemAsync performs a single-partition lookup using both the item ID and partition key, consuming the minimum possible RUs for a read.
How does Azure Cosmos DB multi-region write (multi-master) benefit applications?