Microsoft Azure Data FundamentalsDescribe how to work with non-relational data on AzureMedium
A financial services company stores transactional data in Azure Cosmos DB. The company requires a strong consistency guarantee for critical transactions to ensure that all users see the most up-to-date data immediately after a write operation. Which consistency level should be configured for the Cosmos DB account?
- AStrong
- BEventual
- CSession
- DConsistent Prefix
Show answer & explanationAnswer & explanation
Correct answer: A. Strong
Strong consistency offers the highest level of data consistency, ensuring that all read operations see the most recent write. This is crucial for scenarios like financial transactions where immediate data consistency across all replicas is paramount.
Why the other options are wrong
- B. Eventual consistency offers the lowest consistency guarantee, where replicas eventually converge, but reads may return older data.
- C. Session consistency guarantees that within a single client session, reads will see writes made by that session, but not necessarily by other sessions.
- D. Consistent Prefix ensures that reads will never see out-of-order writes, but may not see the most recent write immediately.
Azure Cosmos DB Consistency Levels
A spectrum of consistency guarantees for data replication in Azure Cosmos DB, ranging from strong to eventual.
- Strong: highest consistency, highest latency.
- Bounded Staleness: reads lag by 'K' updates or 'T' time.
- Session: consistent for a client session.
- Consistent Prefix: reads never see out-of-order writes.
- Eventual: lowest consistency, highest throughput, lowest latency.
Memory trick: Strong for finance, Eventual for chat, Session for you alone.