Microsoft Certified: Azure Developer Associate Azure Cosmos DB Development 1 — Questions and Answers
Question 1: Which consistency level in Azure Cosmos DB provides the strongest consistency guarantee?
- Eventual
- Session
- Bounded Staleness
- Strong (Correct answer)
Correct answer: Strong
Strong consistency ensures linearizability, meaning reads always return the most recent committed version of an item.
Question 2: What is the unit used to measure provisioned throughput in Azure Cosmos DB?
- DTU (Database Transaction Units)
- RU/s (Request Units per second) (Correct answer)
- vCores per second
- IOPS (Input/Output Operations per Second)
Correct answer: RU/s (Request Units per second)
Azure Cosmos DB uses Request Units per second (RU/s) as the abstracted currency for CPU, IOPS, and memory consumed by operations.
Question 3: Which Azure Cosmos DB API is designed for working with graph data and relationships?
- SQL API
- Table API
- Cassandra API
- Gremlin API (Correct answer)
Correct answer: Gremlin API
The Gremlin API (Graph API) supports the Apache TinkerPop Gremlin graph traversal language for modeling and querying graph data.
Question 4: What is the maximum size of a single document (item) in Azure Cosmos DB?
- 1 MB
- 2 MB
- 4 MB (Correct answer)
- 16 MB
Correct answer: 4 MB
Azure Cosmos DB supports individual item (document) sizes up to 2 MB.
Question 5: Which partition key choice would result in the BEST throughput distribution in a Cosmos DB container storing IoT sensor readings?
- deviceRegion
- sensorType
- deviceId (Correct answer)
- readingDate
Correct answer: deviceId
Using deviceId distributes data evenly across logical partitions since each device generates a unique stream of readings, avoiding hot partitions.
Question 6: Which Azure Cosmos DB consistency level guarantees that within a single client session, reads always reflect that client's own writes?
- Consistent Prefix
- Bounded Staleness
- Session (Correct answer)
- Eventual
Correct answer: Session
Session consistency is scoped to a client session and guarantees monotonic reads, monotonic writes, and read-your-writes within that session.
Question 7: What happens when you set Time to Live (TTL) to -1 on an Azure Cosmos DB container?
- Items expire immediately after creation
- TTL is disabled and items never expire (Correct answer)
- Items expire after 1 second
- The container is deleted automatically
Correct answer: TTL is disabled and items never expire
Setting TTL to -1 on the container enables TTL at the container level but items only expire if they have an explicit _ttl property set on them; without it they live forever.
Which consistency level in Azure Cosmos DB provides the strongest consistency guarantee?