Microsoft Azure Data FundamentalsDescribe how to work with non-relational data on AzureHard

A healthcare provider is building an application to manage patient records. These records must be consistent across all replicas, even in the event of network partitions, to ensure data integrity and prevent conflicting updates. Which Azure Cosmos DB consistency level should be chosen?

  1. AStrong
  2. BSession
  3. CEventual
  4. DConsistent Prefix
Show answer & explanation

Correct answer: A. Strong

Strong consistency ensures that all reads see the latest committed write. This is critical for patient records where data integrity and preventing conflicting updates are paramount, even at the cost of higher latency or lower availability during network partitions.

Why the other options are wrong

  • B. Session consistency ensures reads within a client session are consistent, but different clients might see different versions, not meeting the 'all replicas' requirement.
  • C. Eventual consistency offers the lowest latency but provides no ordering guarantees for reads, making it unsuitable for highly sensitive patient data.
  • D. Consistent Prefix guarantees that reads will never see out-of-order writes but does not guarantee the latest write, which is insufficient for strict integrity.

Azure Cosmos DB Strong Consistency

Strong consistency in Azure Cosmos DB guarantees that a read operation returns the most recent committed version of an item. This means that all replicas are synchronized before a read is acknowledged.

  • Highest level of data consistency.
  • Reads always return the latest committed write.
  • Highest latency, lowest availability compared to other levels.
  • Suitable for scenarios requiring absolute data integrity (e.g., financial transactions, patient records).

Memory trick: Consistency: From Weak to Strong, how fresh your data reads are.

More Describe how to work with non-relational data on Azure questions