nerdexam
Microsoft

DP-420 · Question #73

You are building an application that will store data in an Azure Cosmos DB for NoSQL account. The account uses the session default consistency level. The account is used by five other applications…

The correct answer is D. Provide a stored session token when performing read requests E. Associate a session token to the user account. The correct answers are D (Provide a stored session token when performing read requests) and E (Associate a session token to the user account). Session consistency in Azure Cosmos DB guarantees monotonic reads and writes within a single session, identified by a session token…

Integrate an Azure Cosmos DB solution

Question

You are building an application that will store data in an Azure Cosmos DB for NoSQL account. The account uses the session default consistency level. The account is used by five other applications. The account has a single read-write region and 10 additional read region. Approximately 20 percent of the items stored in the account are updated hourly. Several users will access the new application from multiple devices. You need to ensure that the users see the same item values consistently when they browse from the different devices. The solution must NOT affect the other applications. Which two actions should you perform? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.

Options

  • ASet the default consistency level to eventual
  • BAssociate a session token to the device
  • CUse implicit session management when performing read requests
  • DProvide a stored session token when performing read requests
  • EAssociate a session token to the user account

How the community answered

(44 responses)
  • A
    2% (1)
  • B
    7% (3)
  • C
    16% (7)
  • D
    75% (33)

Explanation

The correct answers are D (Provide a stored session token when performing read requests) and E (Associate a session token to the user account). Session consistency in Azure Cosmos DB guarantees monotonic reads and writes within a single session, identified by a session token. By default, a session token is scoped to a single client instance (device). To extend session consistency across multiple devices for the same user, you must capture the session token after each write and store it at the user-account level. When the user reads from a different device, that stored token is passed in the request, ensuring that device also reads data at least as fresh as the last write. This approach does not change the default consistency level (so other applications are unaffected). Options A and C would either weaken consistency or rely on implicit per-client tokens that don't transfer across devices.

Topics

#Cosmos DB consistency#Session token#Application integration#Cross-device data consistency

Community Discussion

No community discussion yet for this question.

Full DP-420 Practice