Question
You have a container in an Azure Cosmos DB for NoSQL account. The container stores data about families. Data about parents, children, and pets are stored as separate documents.
Each document contains the address of each family. Members of the same family share the same partition key named familyId.
You need to update the address for each member of the same family that share the same address. The solution must meet the following requirements:
- Be atomic, consistent, isolated, and durable (ACID).
- Provide the lowest latency.
What should you do?
- A. Update the document of each family member separately by using a patch operation
- B. Update the document of each family member separately and set the consistency level to strong
- C. Update the document of each family member by using a transactional batch operation Correct
Explanation
A transactional batch groups operations on items that share the same partition key value and executes them as a single ACID transaction in one round trip, so all family documents are updated together or not at all with minimal latency. Separate patch operations are each atomic only for a single item, so the set of updates is not one transaction. Strong consistency affects read guarantees and replication, not multi-item atomicity, and it increases latency.