You are designing a global database solution using Azure Cosmos DB. You need to match the specific application requirements on the left to the appropriate Azure Cosmos DB consistency level on the right that meets those requirements with the lowest latency and highest availability.
- A financial reporting application requiring that reads never see out-of-order updates, and replication lag must not exceed minutes or operations.Bounded Staleness consistency
- A stock trading platform where all reads across all regions must return the absolute latest, committed write, accepting higher latency and lower availability.Strong consistency
- A collaborative document editing application where users must always read their own writes immediately, but other users can see updates with a slight delay.Session consistency
- A blog comments section where comments must appear in the order they were posted, but there is no requirement for real-time synchronization.Consistent Prefix consistency
Answer
The collaborative document editor matches Session consistency. The financial reporting application matches Bounded Staleness consistency. The stock trading platform matches Strong consistency. The blog comments section matches Consistent Prefix consistency.
Each application requirement matches the most cost-effective and performant consistency level that satisfies its specific ordering and latency constraints. Strong consistency is used for absolute real-time correctness; Bounded Staleness for predictable regional lag limits; Session for read-your-own-writes session isolation; and Consistent Prefix for basic sequence preservation without real-time synchronization.
Step-by-Step Solution
Key Concept
Azure Cosmos DB Consistency Levels