You are developing a high-throughput shopping cart service using Azure Cosmos DB for NoSQL. The service needs to update a customer's shopping cart document by adding an item. To ensure high efficiency, minimize RU/s consumption, and prevent concurrent modification conflicts without loading the entire document first, which feature should you use?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: Use the Cosmos DB Patch API to perform partial document updates (add/replace/remove) natively on the database server.

The Cosmos DB Patch API enables partial document updates. Instead of downloading the document, modifying it in application memory, and uploading it back (which consumes substantial...

๐Ÿ“‹Part of Microsoft Certified: Azure Developer Associate (AZ-204) ยท Azure Certification Practice
Real Exam ScenarioAzure Cosmos DB

You are developing a high-throughput shopping cart service using Azure Cosmos DB for NoSQL. The service needs to update a customer's shopping cart document by adding an item. To ensure high efficiency, minimize RU/s consumption, and prevent concurrent modification conflicts without loading the entire document first, which feature should you use?

โœ“ Correct Answer & ExplanationAzure Cosmos DB

Correct Answer

Use the Cosmos DB Patch API to perform partial document updates (add/replace/remove) natively on the database server.

Why This Answer Is Correct

The Cosmos DB Patch API enables partial document updates. Instead of downloading the document, modifying it in application memory, and uploading it back (which consumes substantial RU/s and increases network latency), the Patch API applies changes (like adding an item to an array or incrementing a counter) directly on the partition server in a single, highly efficient operation.

๐Ÿ“š What This Question Tests

This question evaluates your knowledge of Azure Cosmos DB โ€” a core concept tested in Microsoft Certified: Azure Developer Associate (AZ-204). Understanding Azure Cosmos DB is essential for designing scalable, secure, and cost-effective cloud architectures. Mastery of this topic will help you answer scenario-based questions confidently on exam day.