exam questions

Exam DP-420 All Questions

View all questions & answers for the DP-420 exam

Exam DP-420 topic 2 question 1 discussion

Actual exam question from Microsoft's DP-420
Question #: 1
Topic #: 2
[All DP-420 Questions]

DRAG DROP -
You have an Azure Cosmos DB Core (SQL) API account that is configured for multi-region writes. The account contains a database that has two containers named container1 and container2.
The following is a sample of a document in container1:
{
"customerId": 1234,
"firstName": "John",
"lastName": "Smith",
"policyYear": 2021
}
The following is a sample of a document in container2:
{
"gpsId": 1234,
"latitude": 38.8951,
"longitude": -77.0364
}
You need to configure conflict resolution to meet the following requirements:
✑ For container1 you must resolve conflicts by using the highest value for policyYear.
✑ For container2 you must resolve conflicts by accepting the distance closest to latitude: 40.730610 and longitude: -73.935242.
✑ Administrative effort must be minimized to implement the solution.
What should you configure for each container? To answer, drag the appropriate configurations to the correct containers. Each configuration may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: Last Write Wins (LWW) (default) mode
Last Write Wins (LWW): This resolution policy, by default, uses a system-defined timestamp property. It's based on the time-synchronization clock protocol.
Box 2: Merge Procedures (custom) mode
Custom: This resolution policy is designed for application-defined semantics for reconciliation of conflicts. When you set this policy on your Azure Cosmos container, you also need to register a merge stored procedure. This procedure is automatically invoked when conflicts are detected under a database transaction on the server. The system provides exactly once guarantee for the execution of a merge procedure as part of the commitment protocol.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/conflict-resolution-policies https://docs.microsoft.com/en-us/azure/cosmos-db/sql/how-to-manage-conflicts

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
YJC
Highly Voted 1 year, 6 months ago
For the highest value wins, there is one description relate to LWW. For API for NoSQL, this may also be set to a user-defined path with a numeric type. In a conflict, the highest value wins. https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-manage-conflicts?tabs=dotnetv2%2Capi-async%2Casync
upvoted 8 times
...
azuredemo2022three
Highly Voted 11 months, 3 weeks ago
Answer Container1: Last Write Wins (default) mode Container2: Merge Procedures (custom) mode
upvoted 7 times
...
Shaunp
Most Recent 1 year, 7 months ago
what is the correct order Procedure and applicant?
upvoted 1 times
...
TimSss
1 year, 8 months ago
it is explicitly stated that LWW used the DEFAULT (timestamp) mode, so increasing policyYear will not be used by LWW
upvoted 3 times
...
DrC
1 year, 9 months ago
I don't see how the default (last one to write wins) would handle "the highest value for policyYear" if there was a conflict. Both should be procedures.
upvoted 3 times
ognamala
1 year, 9 months ago
Both answers are correct, remember that a LWW policy can be configured to use any numeric path, not just the timestamp, so it can be configured with the /policyYear path where the highest number will win and it would satisfy the requirement
upvoted 4 times
Torent2005
1 year, 8 months ago
Not really, default mode for LWW is based on timestamp. "Last Write Wins (LWW): This resolution policy, by default, uses a system-defined timestamp property. It's based on the time-synchronization clock protocol. If you use the SQL API, you can specify any other custom numerical property (e.g., your own notion of a timestamp) to be used for conflict resolution. A custom numerical property is also referred to as the conflict resolution path." https://learn.microsoft.com/en-us/azure/cosmos-db/conflict-resolution-policies For Merge Procedures (custom) mode it's also not possible because you should set this policy during container creation. You can't do this for existing container. "Custom conflict resolution policy is available only for SQL API accounts and can be set only at creation time. It is not possible to set a custom resolution policy on an existing container." So the correct options for both containers is the last one - "an application that reads from the conflict feed.
upvoted 3 times
Torent2005
1 year, 8 months ago
In general, you can't modify conflict policy after container creation.
upvoted 1 times
...
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...