Free DP-420 Exam Braindumps
Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB Questions 66–70 (page: 15)

Updated On: 16-Nov-2026
View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have an Azure Cosmos DB for NoSQL container that contains the following item.

You need to update the OrderQty value to 5 by using a patch operation.
How should you complete the JSON Patch document? To answer, select the appropriate options in the answer area.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: add
Partial document update in Azure Cosmos DB
Supported operations
This table summarizes the operations supported by this feature.
Note: target path refers to a location within the JSON document
* Add
Add performs one of the following, depending on the target path:
• If the target path specifies an element that doesn't exist, it's added.
• If the target path specifies an element that already exists, its value is replaced.
• If the target path is a valid array index, a new element is inserted into the array at the specified index. This shifts existing elements after the new element.
• If the index specified is equal to the length of the array, it appends an element to the array. Instead of specifying an index, you can also use the - character. It also results in the element being appended to the array.
Note: Specifying an index greater than the array length results in an error.
* Etc.
Box 2: /items[0]/OrderQty
JSON Array Structure
A JSON array contains zero, one, or more ordered elements, separated by a comma. The JSON array is surrounded by square brackets [ ].
A JSON array is zero terminated, the first index of the array is zero (0). Therefore, the last index of the array is length - 1.
Note: Azure Cosmos DB Partial Document Update feature (also known as Patch API) provides a convenient way to modify a document in a container. Currently, to update a document the client needs to read it, execute Optimistic Concurrency Control checks (if necessary), update the document locally and then send it over the wire as a whole document Replace API call.
Partial document update feature improves this experience significantly. The client can only send the modified properties/fields in a document without doing a full document replace operation.


Reference:

https://learn.microsoft.com/en-us/azure/cosmos-db/partial-document-update https://www.microfocus.com/documentation/silk-performer/205/en/silkperformer-205-webhelp-en/GUID-0847D E13-2A2F-44F2-A6E7-214CD703BF84.html



View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have an Azure Cosmos DB for NoSQL account named Cosmos1 that has a container named orders. You have an Azure Synapse Analytics workspace named WS1 that accesses Cosmos1 by using a managed private endpoint and can query the analytical store of Cosmos1.
You have an Apache Spark notebook that reads from the analytical store of Cosmos1.
Analysts report that newly updated documents are NOT always reflected immediately in Spark processing.
You need to query the current operational data from Spark instead of the analytical store. The solution must meet the following requirements:
● Read from the transactional store.
● Continuously process new and updated items.
● Configure the transactional store to be accessed by using the managed private endpoint.
How should you complete the query? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: "cosmos.oltp"
To meet your requirements, you should use the oltp format in your Spark read stream.
Transactional Store Access: In the Azure Cosmos DB Spark connector, oltp directly targets the row-oriented, transactional data store (operational data), whereas olap targets the column-oriented analytical store.
Real-time Change Feed Processing: Reading from the transactional store using spark.readStream with oltp leverages the Cosmos DB Change Feed internally. This guarantees that new inserts and updates are captured immediately and continuously in real time, eliminating the sync latency associated with the analytical store.
Managed Private Endpoint Compatibility: Setting the format to oltp ensures that your queries route directly through the configured network path to the transactional endpoint, allowing you to secure and enforce access strictly through your managed private endpoint.
Box 2: connection.mode
The specific spark.readStream option you need to use is spark.cosmos.connection.mode, set to the value Gateway.
Python code sample:
fStream = spark.readStream \
.format("cosmos.oltp") \
.option("spark.synapse.linkedService", "<linked-service-name>") \
.option("spark.cosmos.container", "orders") \
.option("spark.cosmos.changeFeed.readEnabled", "true") \
.option("spark.cosmos.connection.mode", "Gateway") \
.load()


Reference:

https://sidequests.blog/2023/02/20/loading-your-cosmos-db-data-into-a-synapse-spark-notebook/



View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have an Azure Cosmos DB for NoSQL container named Container1 that contains items in the following format.

You need to identify five items that contain more than 20 nutrients and have the units property set to mg.
How should you complete the query? To answer, select the appropriate options in the answer area.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: JOIN
In Azure Cosmos DB, you perform an intra-document join using the JOIN keyword to combine the parent item with its nested child arrays.
Box 2: COUNT (1)
The internal COUNT(1) counts every nutrient matching the "mg" string filter, allowing the outer WHERE count_mg > 20 clause to properly filter the items.



View Related Case Study

You are designing a denormalized Azure Cosmos DB database named DB1 to support an ecommerce app. DB1 will contain the following containers:
● productCategory
● productTag
● product
Updates and deletions for records in the productCategory and productTag containers will be used to implement referential integrity for the product container.
You need to recommend a solution to implement referential enforcement. The solution must minimize development effort.
What should you recommend?

  1. Periodically run a scheduled batch job that scans all the records in the product, productCategory, and productTag containers to identify inconsistencies.
    When discrepancies are found, update or delete the records in the product container to maintain referential integrity based on the current state of the master data.
  2. Implement a change feed processor for both the productCategory and productTag containers.
    When a change is detected, propagate updates or deletions to the related records in the product container to maintain referential integrity.
  3. Enable multi-region writes for all the containers. Configure automatic synchronization rules between the all the containers. Use the built-in conflict resolution policies to maintain referential integrity across the containers.
  4. Enable change data capture (CDC) and configure downstream data pipelines to automatically sync updates and deletions from the productCategory and productTag containers to the product container to maintain referential integrity.

Answer(s): B

Explanation:

To minimize development effort while maintaining referential integrity in a denormalized Azure Cosmos DB database, you should use Azure Cosmos DB Change Feed with an Azure Function trigger.
Because Azure Cosmos DB does not natively support cross-document referential integrity or cascading updates/deletes, handling this asynchronously via the Change Feed requires significantly less development and maintenance effort than writing and managing complex transactional stored procedures or implementing multi-document transactional logic within your application code.
Using the Change Feed approach allows you to build a decoupled, event-driven architecture that automatically syncs changes from your lookup containers (productCategory and productTag) to your main product container.


Reference:

https://microsoftlearning.github.io/dp-420-cosmos-db-dev/instructions/17-denormalize.html



View Related Case Study

You have an Azure Cosmos DB for NoSQL account that hosts a container named Container1.
You need to implement a change feed pull model for Container1 and parallelize the model’s processing by using the Azure Cosmos DB .NET SDK.
Which programmatic construct should you use?

  1. the LeaseContainerContent class
  2. the PageSizeHint property
  3. the WithPollInterval method
  4. the FeedRange class

Answer(s): D

Explanation:

To parallelize processing in the Azure Cosmos DB change feed pull model using the .NET SDK, you must use the FeedRange class.
When utilizing the change feed pull model, work is not automatically load-balanced or scaled out (unlike the push model's change feed processor). To achieve parallel execution across multiple threads or machines, you explicitly split the workload by its range of partition key values:


Reference:

https://dev.to/shibayan/first-steps-of-the-change-feed-pull-model-in-azure-cosmos-db-34p



Viewing page 15 of 61
Viewing questions 71 - 75 out of 296 questions


Post your Comments and Discuss Microsoft DP-420 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!