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

A global e-commerce platform uses Azure Cosmos DB to store product catalog information. To ensure maximum data availability and minimal downtime, the platform needs to withstand regional outages with no data loss and maintain a strong consistency guarantee for critical operations, while still providing low-latency reads globally. Which consistency level, combined with global distribution, best meets these requirements?

  1. AConsistent Prefix
  2. BStrong Consistency
  3. CBounded Staleness
  4. DEventual Consistency
Show answer & explanation

Correct answer: B. Strong Consistency

Strong Consistency in Azure Cosmos DB guarantees that reads always return the most recent committed version of an item. Combined with global distribution, it ensures that all replicas are consistent before a write is acknowledged, preventing data loss and providing a strong guarantee, even during regional outages (with multi-region writes enabled). While it has higher latency for writes, the question emphasizes 'no data loss' and 'strong consistency guarantee' for critical operations.

Why the other options are wrong

  • A. Consistent Prefix guarantees that reads will never see out-of-order writes, but updates can still be eventually consistent.
  • C. Bounded Staleness provides a bound on how far behind the primary replica a secondary replica can be, still allowing for some staleness.
  • D. Eventual Consistency offers the lowest latency but provides the weakest consistency guarantee, allowing for potential data inconsistencies after a write.

Azure Cosmos DB Strong Consistency

The highest consistency level in Azure Cosmos DB, guaranteeing that reads always return the most recent committed version of an item, and writes are globally replicated before being acknowledged.

  • Reads always see the latest committed write.
  • Highest data consistency guarantee across all regions.
  • Highest latency for writes, lowest throughput compared to other levels.
  • Ensures no data loss and strong consistency even with global distribution.

Memory trick: Consistency levels are like 'promises' about your data's freshness: Strong is a firm handshake, Eventual is a casual nod.

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