Free DP-420 Exam Braindumps
Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB Questions 31–35 (page: 26)

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

DRAG DROP (Drag and Drop is not supported)
You have an Azure subscription that contains an Azure Cosmos DB for NoSQL account in the East US Azure region. The account hosts a container named Container1. A read-only replica of the account is available in the Australia East Azure region.
You need to make the following changes:
● Allow writes in both regions.
● Apply a custom conflict resolution policy to Container1.
Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
Note: More than one order of answer choices is correct. You will receive credit for any of the correct orders you select.
Select and Place:

  1. See Explanation section for answer.

Answer(s): A

Explanation:




To allow writes in both regions and apply a custom conflict resolution policy, you should take the following three sequential actions:
Step 1: Enable multi-region writes for the account.
Multi-region writes: By default, an Azure Cosmos DB account allocates writes to a single region. Enabling multi-region writes changes the read-only replica in the Europe region into a writeable replica.
Step 2: Drop Container1
Delete the existing container.
Recreating the container: In Azure Cosmos DB, conflict resolution policies can only be specified at container creation time and cannot be modified on an existing container. Because the account already hosts a container, you must delete and recreate it to apply the policy.
Step 3: Create Container1
Create a new container configured with the custom conflict resolution policy and register your merge stored procedure.
Fourth step:
Custom policy execution: When choosing a custom conflict resolution policy, registering a JavaScript merge stored procedure is required to automatically execute and resolve the concurrent regional write conflicts.


Reference:

https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-multi-master?tabs=api-async



View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have an Azure Cosmos DB for NoSQL database named db1.
You run the following .NET code.

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: No
No - Three unique keys will be defined for Container1.
Three unique keys will not be defined for the container. Instead, one unique key consisting of a composite of three paths will be defined.
In Azure Cosmos DB, a single UniqueKey object contains a collection of Paths.
When you add multiple strings inside a single UniqueKey.Paths collection, Cosmos DB treats them as a single composite unique key.
Box 2: No
No - A unique key will be create in the /customerId field.
The /customerId path is defined as your Partition Key Path.
Scope of Uniqueness: Unique keys in Azure Cosmos DB apply within each logical partition, not across them.
The Actual Unique Key: The code creates a single composite unique key on the combination of {"/firstName", "/lastName", "/emailAddress"}.
Box 3: No
No - Items stored in Container1 will be deleted one hour after they are created.
No, items stored in the container will not automatically be deleted exactly one hour after they are created unless they lack a specific modification time or custom Time to Live (TTL) value.
In Azure Cosmos DB, when DefaultTimeToLive is set to a positive integer (like 3600 seconds), it establishes a default behavior, but the deletion clock is based on the item's last modified timestamp (_ts), not its creation timestamp.


Reference:

https://learn.microsoft.com/en-us/cosmos-db/time-to-live



View Related Case Study

You have an Azure subscription. The subscription contains an Azure Cosmos DB for NoSQL account named account1 that has multi-region writes configured.
In account1, you need to create a container that will resolve conflicts automatically by using a custom conflict resolution policy.
What should you create first?

  1. a stored procedure
  2. a post-trigger
  3. a pretrigger
  4. a user-defined function (UDF)

Answer(s): A

Explanation:

A stored procedure must be created first when configuring a custom conflict resolution policy in an Azure Cosmos DB for NoSQL container.
1. Register Stored Procedure
Before you can provision or configure the container with a custom conflict resolution policy, the JavaScript-based stored procedure that contains your custom merge logic must already exist.
2. Configure Container PolicyWhen creating the container, you must set the conflict resolution mode to Custom and pass the specific name of the pre-registered stored procedure as the resolution path.


Reference:

https://learn.microsoft.com/en-us/answers/questions/2224965/409-conflict-error-using-multi-write-regions



View Related Case Study

You are designing an Azure Cosmos DB for NoSQL solution to store data from IoT devices. Writes from the devices will occur every second. Data will be retained indefinitely.
The following is a sample of the data.

You need to select a partition key that meets the following requirements for writes:
-Minimizes the partition skew
-Avoids capacity limits
-Avoids hot partitions
What should you do?

  1. Create a new synthetic key that contains deviceId and timestamp.
  2. Use deviceId as the partition key.
  3. Use deviceManufacturer as the partition key.
  4. Create a new synthetic key that contains deviceId and sensor1Value.

Answer(s): A

Explanation:

To minimize partition skew and avoid the 20 GB logical partition limit for an IoT workload, you should use Hierarchical Partition Keys.
This modern feature allows you to define up to three partition keys, creating a sub-partitioning structure that scales beyond a single device's data limits.
The Optimal Key Structure
For your specific data, the best practice is a 2-level hierarchy:
Level 1: deviceID
Ensures high cardinality (thousands of unique values).
Groups data logically for device-specific queries.
Level 2: timestamp (truncated to Day or Month)
Prevents any single device from hitting the 20 GB logical partition limit over time.
A device reporting every second generates ~86,400 records/day; adding a date suffix ensures the "logical partition" resets each period.


Reference:

https://learn.microsoft.com/en-us/azure/cosmos-db/design-partitioning-iot



View Related Case Study

You have an Azure subscription.
You plan to deploy a solution that will use the Azure Cosmos DB free tier.
You need to maximize the number of containers that can use the free-tier request units per second (RU/s).
What should you create first?

  1. a single provisioned throughput account and a database that has throughput provisioned
  2. a single provisioned throughput account and a database that does NOT have throughput provisioned
  3. a single serverless account
  4. multiple serverless accounts

Answer(s): A

Explanation:

Provisioning throughput at the database level allows up to 25 containers in that database to share the 1,000 RU/s included with the free tier. This maximizes container usage of the shared throughput allowance. Enable the free-tier discount when creating the account.


Reference:

https://learn.microsoft.com/en-us/azure/cosmos-db/free-tier#free-tier-with-shared-throughput-database



Viewing page 26 of 61
Viewing questions 126 - 130 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!