Exam AZ-204 All QuestionsBrowse all questions from this exam
Question 144

You are developing an inventory tracking solution. The solution includes an Azure Function app containing multiple functions triggered by Azure Cosmos DB. You plan to deploy the solution to multiple Azure regions.

The solution must meet the following requirements:

• Item results from Azure Cosmos DS must return the most recent committed version of an item.

• Items written to Azure Cosmos DB must provide ordering guarantees.

You need to configure the consistency level for the Azure Cosmos DB deployments.

Which consistency level should you use?

    Correct Answer: D

    Strong consistency ensures that all reads return the most recent committed version of an item and provides strict ordering guarantees for writes. This consistency level is appropriate for scenarios where it is essential to always read the latest committed data, regardless of latency trade-offs, as it meets both the requirements of returning the most recent committed version and maintaining ordered writes.

Discussion
XardasOption: C

I believe its C 'bounded staleness' Because strong consistency is not supported for multiple regions

tarek0811

Azure Cosmos DB accounts configured with multiple write regions can't be configured for strong consistency as it isn't possible for a distributed system to provide an RPO of zero and an RTO of zero https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels

oskx2

That is true but there is no mention of "multiple write regions" mentioned in the question. You can have strong consistency and multiple regions (notice it is not multiple write regions): https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels#write-latency-and-strong-consistency

1CY1

...strong consistency completes an operation only after ensuring that it has been committed to all regions within an account. https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels#write-latency-and-strong-consistency

manopeydakon

Yes, the Strong consistency level is supported in Azure Cosmos DB for multiple regions. When you configure Azure Cosmos DB with multiple regions, you have the option to choose the consistency level that fits your application's requirements. The Strong consistency level ensures that, regardless of the region being accessed, each read operation returns the most recent committed version of an item and maintains ordering guarantees. This is achieved by synchronously replicating writes across all regions before acknowledging the write operation.

LuchoGonzalezOption: D

Strong consistency offers a linearizability guarantee. Linearizability refers to serving requests concurrently. The reads are guaranteed to return the most recent committed version of an item. A client never sees an uncommitted or partial write. Users are always guaranteed to read the latest committed write. Source: https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels

jobolesonihalOption: D

The problem doesn't specify any condition (versions or time lag) which may allow bounded staleness. Only Strong consistency guarantees the reading the more recent commit.

lednariOption: D

Strong - doesnt mention multi-region writes - the multi-region functions are triggered hence reads

RikinPatelOption: D

strong is correct ans.: Strong consistency: Strong consistency offers a linearizability guarantee. Linearizability refers to serving requests concurrently. The reads are guaranteed to return the most recent committed version of an item. A client never sees an uncommitted or partial write. Users are always guaranteed to read the latest committed write. Bounded staleness consistency: With Bounded Staleness consistency, reads issued against a non-primary region may not necessarily return the most recent version of the data globally, but are guaranteed to return the most recent version of the data in that region, which will be within the maximum staleness boundary globally. https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels

drkpnsh

But for Strong consistency, it also says Bounded Staleness in a multi-write account is an anti-pattern. So I really don't understand what the correct answer is. Bounded Staleness or Strong?

PapeeOption: C

C. bounded staleness Item results return the most recent committed version of an item: Bounded staleness ensures that reads are served from a version of the data that is within a specified lag from the current write operation. This means that you can read the most recent committed version of an item while still providing a level of consistency. Items written to Azure Cosmos DB must provide ordering guarantees: Bounded staleness guarantees that writes are ordered and committed before being read. While other consistency levels like "Strong" and "Consistent prefix" also provide strong consistency, "Bounded staleness" offers a balance between consistency and availability, which is suitable for scenarios where the most recent data is needed with some level of delay.

ay_m

"Reads when using Bounded Staleness returns the latest data available in that region by reading from two available replicas in that region." With bounded staleness there is a certain amount of lag, so it does not return the most recently committed write

XardasOption: C

Correct answer is C 'bounded staleness' Question mentions deployment to multiple regions, and strong consistency is not supported for that.

junix_Option: D

I believe `Strong` consistency is correct.

CarlosTheBoldestOption: C

The key is the multiple regions

tamermOption: D

I think it's D. Strong consistency is not supported for multiple WRITE regions, and I don't see any such requirements in the question. https://learn.microsoft.com/en-us/azure/cosmos-db/high-availability#multiple-write-regions

RikinPatel

as per Que.: You plan to deploy the solution to multiple Azure regions.

75daltonicOption: D

I think is strong

MunwalinwaliOption: D

"Most recent"

FeriAZOption: D

Item results from Azure Cosmos DB must return the most recent committed version of an item: Strong consistency ensures that once a write operation is acknowledged, all subsequent read operations will return the most recent committed version of the data. This means that any read operation will see the effects of the latest write operation. Items written to Azure Cosmos DB must provide ordering guarantees: Strong consistency also ensures ordering guarantees. It means that if one write operation is acknowledged before another, then the order of these operations is preserved for all subsequent read operations.

JarynplOption: C

Azure Cosmos DB accounts configured with multiple write regions can't be configured for strong consistency as it isn't possible for a distributed system to provide an RPO of zero and an RTO of zero. Additionally, there are no write latency benefits on using strong consistency with multiple write regions because a write to any region must be replicated and committed to all configured regions within the account. This scenario results in the same write latency as a single write region account. https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels#strong-consistency-and-multiple-write-regions

Weam

but the question didn't mention that there will be multiple WRITE regions ?

Vladimir_GajinovOption: C

I think it's Bounded Staleness because it's not mentioned that read is executed right after write operation so I think it's acceptable to have small latency between write and read operations. I would go with this!