You are designing a globally distributed application that utilizes Azure Cosmos DB. You need to select the most appropriate consistency level for three different application scenarios to meet their architectural requirements while optimizing for request units (RUs) and performance. Match each application scenario to its optimal Azure Cosmos DB consistency level.
- A retail checkout application uses a globally distributed Azure Cosmos DB account configured with a single-write region and multiple read regions. To prevent stock discrepancies, client applications must be guaranteed to read the most recent, fully committed write from any region, regardless of latency overhead.Strong consistency
- An e-commerce user profile application runs on a globally distributed Azure Cosmos DB account with multiple read regions. A web application must guarantee that a user who edits their shipping address will always see the updated address on subsequent page loads within their browser session. Other users do not need to see the update immediately.Session consistency
- A global package tracking application uses an Azure Cosmos DB account with multiple write regions. The tracking system logs package scan events sequentially (e.g., 'Departed facility' must never be visible before 'Arrived at facility'). The application must guarantee that reads see updates in their exact write order, while keeping Request Unit (RU) costs lower than Bounded Staleness.Consistent Prefix consistency
Cevap
The retail checkout application scenario matches Strong consistency, the e-commerce user profile application matches Session consistency, and the global package tracking application matches Consistent Prefix consistency.
The correct pairings align each scenario with the lowest-overhead consistency level that satisfies its core requirements. The checkout system requires Strong consistency to prevent stock discrepancies. The user profile updates are scoped to a browser session, making Session consistency the ideal choice for read-your-own-writes. The tracking system requires ordered updates without real-time consistency, which is satisfied by Consistent Prefix at a lower cost than Bounded Staleness.
Adım Adım Çözüm
Anahtar Kavram
Understanding and selecting Azure Cosmos DB consistency levels based on application requirements, latency, ordering guarantees, and resource cost.