exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 3 question 28 discussion

Actual exam question from Microsoft's AZ-204
Question #: 28
Topic #: 3
[All AZ-204 Questions]

You are developing a .Net web application that stores data in Azure Cosmos DB. The application must use the Core API and allow millions of reads and writes.
The Azure Cosmos DB account has been created with multiple write regions enabled. The application has been deployed to the East US2 and Central US regions.
You need to update the application to support multi-region writes.
What are two possible ways to achieve this goal? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.

  • A. Update the ConnectionPolicy class for the Cosmos client and populate the PreferredLocations property based on the geo-proximity of the application.
  • B. Update Azure Cosmos DB to use the Strong consistency level. Add indexed properties to the container to indicate region.
  • C. Update the ConnectionPolicy class for the Cosmos client and set the UseMultipleWriteLocations property to true.
  • D. Create and deploy a custom conflict resolution policy.
  • E. Update Azure Cosmos DB to use the Session consistency level. Send the SessionToken property value from the FeedResponse object of the write action to the end-user by using a cookie.
Show Suggested Answer Hide Answer
Suggested Answer: AC 🗳️

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
coffecold
Highly Voted 2 years, 6 months ago
The goal is "You need to update the application to support multi-region writes", that is enable multi-region writes (bool, option C) and add the regions (option A) Then you have to apply the Conflict resolution policies.This can be LLW(default, not mentioned) or custom (option D). Hence : there is only ONE way to to support multi-region writes (both apply C AND A) and there are subsequently TWO ways to apply the Conflict resolution policies (@ SQL) to solve write, update and delete conflicts of which one is mentioned in the question (D). To support multi-region writes I would answer A and C , but they have to be set both, not one or the other. See https://learn.microsoft.com/en-us/azure/cosmos-db/sql/how-to-multi-master?tabs=api-async and https://learn.microsoft.com/en-us/azure/cosmos-db/conflict-resolution-policies
upvoted 20 times
dgcc97
2 years, 4 months ago
From the documentation you provided: Within the ConnectionPolicy, set UseMultipleWriteLocations to true and pass the name of the region where the application is deployed to ApplicationRegion. This will populate the PreferredLocations property based on the geo-proximity from location passed in. If a new region is later added to the account, the application does not have to be updated or redeployed, it will automatically detect the closer region and will auto-home on to it should a regional event occur. I take that paragraph to mean that it automatically updates the PreferredLocations property, when you set the UseMultipleWriteLocations property with true and pass the region name. That means you actually only need to update UseMultipleWriteLocations, thus C. And as you mentioned, apply the Conflict resolution policies (D).
upvoted 4 times
warchoon
2 years, 2 months ago
It's a trick. "you must make two changes in your application to the ConnectionPolicy" "pass the name of the region where the application is deployed to ApplicationRegion. This will populate the PreferredLocations property". I think this is an "update" https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-multi-master?tabs=api-async#:~:text=you%20must%20make%20two%20changes%20in%20your%20application%20to%20the%20ConnectionPolicy
upvoted 2 times
...
...
...
baroo1
Highly Voted 2 years, 2 months ago
Selected Answer: AC
A + C = Clearly stated in documentation that both are required: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-multi-master?tabs=api-async. And according to the question "Each correct answer presents part of the solution". "Part" Not D -> "Custom conflict resolution policy is available only for API for NoSQL accounts and can be set only at creation time." The question states the account was already created. Source: https://learn.microsoft.com/en-us/azure/cosmos-db/conflict-resolution-policies
upvoted 13 times
...
8ac3742
Most Recent 8 months, 3 weeks ago
D is not answer, Conflict resolution policy can only be specified at container creation time and cannot be modified after container creation, however the question mentions that "You need to update the application to support multi-region writes.", so we suppose that the containter has been created before we update ConnectionPolicy, so D is not applicable. The answer is C+A, set UseMultipleWriteLocation and PreferredLocation.
upvoted 1 times
...
singhdamodar3
1 year, 4 months ago
Selected Answer: CD
C. Setting the UseMultipleWriteLocations property to true allows the Cosmos DB SDK to automatically route write operations to the closest available write region, improving write latency. This is a key configuration for enabling multi-region writes. D - is relevant in scenarios where conflict resolution needs customization,
upvoted 1 times
...
applepie
1 year, 9 months ago
got this question today, answer A,C - 7/30/2023, score 895/1000
upvoted 1 times
...
JH81
1 year, 10 months ago
Selected Answer: AC
Got this on 6/28/2023 and passed with 850. Went with A, C.
upvoted 2 times
...
deathRac3
1 year, 11 months ago
Selected Answer: AC
A&C to support multi-region writes
upvoted 2 times
...
nekkilodeon
2 years ago
Selected Answer: AC
A & C https://learn.microsoft.com/en-us/azure/cosmos-db/sql/how-to-multi-master?tabs=api-async
upvoted 2 times
...
adilkhan
2 years ago
A,C chat gpt
upvoted 2 times
...
vikas4239
2 years, 2 months ago
A&C ConnectionPolicy, set UseMultipleWriteLocations to true and pass the name of the region where the application is deployed to ApplicationRegion. This will populate the PreferredLocations property based on the geo-proximity from location passed in https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-multi-master?tabs=api-async
upvoted 1 times
...
AkhiRk
2 years, 2 months ago
Answer should be CD The questions mentions .NET web application and if you check below link you can see for .net the option C goes And for multi write scenarios conflict might arise and hence option D https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-multi-master?tabs=api-async
upvoted 2 times
...
Esward
2 years, 3 months ago
AC are the correct answers as per microsoft docs https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-multi-master?tabs=api-async
upvoted 1 times
...
imanonion
2 years, 3 months ago
Selected Answer: AC
Option C: Update the ConnectionPolicy class for the Cosmos client and set the UseMultipleWriteLocations property to true. This will enable the application to use multiple write regions when storing data in Azure Cosmos DB. Option A: Update the ConnectionPolicy class for the Cosmos client and populate the PreferredLocations property based on the geo-proximity of the application. This will allow the application to use the closest write region to the application's location, improving performance and reducing latency. Other options, such as updating the consistency level or creating a custom conflict resolution policy, are not directly related to enabling multi-region writes and are not necessary for this goal.
upvoted 4 times
...
rotimislaw
2 years, 3 months ago
Selected Answer: AC
As stated by others
upvoted 2 times
...
Siepie
2 years, 4 months ago
Correct answers should be A and C ConnectionPolicy policy = new ConnectionPolicy { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Protocol.Tcp, UseMultipleWriteLocations = true ----> C }; policy.SetCurrentLocation("West US 2"); -----> A
upvoted 4 times
Siepie
2 years, 4 months ago
Sorry SetCurrentLocation is only the region in which the application is being deployed and where Azure Cosmos DB is replicated. But the ConnectionPolicy class does also have a property PreferredLocations: Gets and sets the preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. For example, "East US" as the preferred location.
upvoted 1 times
...
...
OPT_001122
2 years, 6 months ago
C and D are the correct answers?
upvoted 1 times
POOOJAAAAAAAAAA
2 years, 4 months ago
IMO C and D
upvoted 1 times
...
...
[Removed]
2 years, 6 months ago
The documentation says: " To enable multi-region writes in your application, set ApplicationRegion to the region in which the application is being deployed and where Cosmos DB is replicated" Now the option to use that property is in .Net SDK V2. Microsoft says I do not need to know .Net for this exam and they ask questions from V2? So, I should try this in both v2 and v3 to be able to pass this exam.
upvoted 2 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago