Soru

Zorluk: OrtaSet Consistency Levels for Azure Cosmos DB

An organization is deploying a globally distributed discussion forum application. The database is hosted on an Azure Cosmos DB API for NoSQL account configured with a single write region in East US and a read region in West US. To prevent hot partitions, the development team has configured a high-cardinality partition key on the container. The application requires that users reading posts in West US must always see updates in the exact chronological order in which they were written. Additionally, the database must minimize Request Unit (RU) costs, ensuring read operations consume only 1 RU. Which two consistency levels should you select to meet these requirements? (Select two.)

  1. A
    Strong
  2. B
    Bounded Staleness
  3. SessionCevap
  4. Consistent PrefixCevap
  5. E
    Eventual

Cevap

Session and Consistent Prefix
The correct options are Session and Consistent Prefix. Consistent Prefix guarantees that readers will see updates in the order they were written. Session consistency also guarantees consistent prefix order (along with read-your-writes, monotonic reads, and monotonic writes within a session). Both Session and Consistent Prefix consistency levels use a single replica read, which costs 1 RU for standard 1 KB point reads.

Adım Adım Çözüm

1
Analyze the consistency order requirement
Strong, Bounded Staleness, Session, and Consistent Prefix all guarantee that reads will see updates in the order they were written (consistent prefix guarantee). Eventual consistency does not guarantee order.
Eliminating Eventual consistency as a candidate because it violates the chronological ordering requirement.
2
Analyze the Request Unit (RU) cost constraint
Strong and Bounded Staleness require quorum reads, which cost 2 RUs. Session and Consistent Prefix require only a single replica read, which costs 1 RU.
Eliminating Strong and Bounded Staleness because they fail to minimize RU costs.
3
Select the matching consistency levels
Session and Consistent Prefix are the only two options that guarantee ordered reads and cost 1 RU.
Matching both constraints leaves Session and Consistent Prefix as the correct selections.

Anahtar Kavram

Azure Cosmos DB consistency levels and their trade-offs in terms of read latency, RU cost, and ordering guarantees.
Bu soruyu puanla