DP-420 · Question #136
You have an Azure Cosmos DB for NoSQL account that uses the default consistency level. How can the consistency level be modified as part of a query request?
The correct answer is D. weaker consistency for read operations. The consistency level for an Azure Cosmos DB for NoSQL account can be overridden per-request for read operations to specify a weaker consistency.
Question
You have an Azure Cosmos DB for NoSQL account that uses the default consistency level. How can the consistency level be modified as part of a query request?
Options
- Astronger consistency for write operations
- Bweaker consistency for write operations
- Cstronger consistency for read operations
- Dweaker consistency for read operations
How the community answered
(31 responses)- A6% (2)
- C3% (1)
- D90% (28)
Why each option
The consistency level for an Azure Cosmos DB for NoSQL account can be overridden per-request for read operations to specify a weaker consistency.
Consistency levels are defined for read and write operations, but you cannot request a stronger consistency than the account's default for a specific read or write request, nor is overriding consistency for write operations a typical use case for queries.
While write operations have consistency, the question refers to modifying consistency as part of a 'query request,' which implies read operations, and weakening consistency for write operations is not how this feature is typically used.
You can only request a weaker consistency level than the account's default for read operations, not a stronger one.
Azure Cosmos DB allows applications to override the default consistency level set at the account level for specific requests. This override is typically used to request a weaker consistency for read operations to gain lower latency and higher throughput when strict consistency is not critical for that particular query.
Concept tested: Cosmos DB per-request consistency override
Source: https://learn.microsoft.com/azure/cosmos-db/consistency-levels#override-the-default-consistency-level
Topics
Community Discussion
No community discussion yet for this question.