An application stores multiple documents per username and must support updating multiple documents for the same username in a single ACID transaction. How should you configure Azure Cosmos DB to meet this requirement?
Choose an answer
Tap an option to check your answer.
Correct answer: Create an unsharded collection to store documents., Configure Azure Cosmos DB to use the MongoDB API..
Why this is the answer
The correct answer is to create an unsharded collection to store documents. Azure Cosmos DB guarantees ACID transactions within a single logical partition. If all documents for a given username are in the same logical partition, operations on those documents can be part of a single transaction. An unsharded collection (a collection without a partition key) effectively places all documents into a single logical partition, thus enabling multi-document ACID transactions for all documents within that collection. Configuring Azure Cosmos DB to use the MongoDB API is also correct because the MongoDB API supports multi-document transactions within a replica set (which maps to a logical partition in Cosmos DB). Creating a collection sharded on username would distribute documents across multiple logical partitions, preventing multi-document ACID transactions across all documents for a single username if they reside on different partitions. The Gremlin API is for graph databases and does not inherently provide multi-document ACID transaction capabilities across arbitrary documents in the way an unsharded collection or the MongoDB API does for this scenario.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed