Free Microsoft DP-420 Exam Braindumps (page: 3)

You are designing an Azure Cosmos DB Core (SQL) API solution to store data from IoT devices. Writes from the devices will be occur every second.
The following is a sample of the data.



You need to select a partition key that meets the following requirements for writes:
Minimizes the partition skew
Avoids capacity limits
Avoids hot partitions
What should you do?

  1. Use timestamp as the partition key.
  2. Create a new synthetic key that contains deviceId and sensor1Value.
  3. Create a new synthetic key that contains deviceId and deviceManufacturer.
  4. Create a new synthetic key that contains deviceId and a random number.

Answer(s): D

Explanation:

Use a partition key with a random su x. Distribute the workload more evenly is to append a random number at the end of the partition key value. When you distribute items in this way, you can perform parallel write operations across partitions.
Incorrect Answers:
A: You will also not like to partition the data on DateTime , because this will create a hot partition. Imagine you have partitioned the data on time, then for a given minute, all the calls will hit one partition. If you need to retrieve the data for a customer, then it will be a fan-out query because data may be distributed on all the partitions.
B: Senser1Value has only two values.
C: All the devices could have the same manufacturer.


Reference:

https://docs.microsoft.com/en-us/azure/cosmos-db/sql/synthetic-partition-keys
D (78%) C (22%)



You maintain a relational database for a book publisher. The database contains the following tables.



The most common query lists the books for a given authorId.
You need to develop a non-relational data model for Azure Cosmos DB Core (SQL) API that will replace the relational database. The solution must minimize latency and read operation costs.
What should you include in the solution?

  1. Create a container for Author and a container for Book. In each Author document, embed bookId for each book by the author. In each Book document embed authorId of each author.
  2. Create Author, Book, and Bookauthorlnk documents in the same container.
  3. Create a container that contains a document for each Author and a document for each Book. In each Book document, embed authorId.
  4. Create a container for Author and a container for Book. In each Author document and Book document embed the data from Bookauthorlnk.

Answer(s): A

Explanation:

Store multiple entity types in the same container.



You have an Azure Cosmos DB Core (SQL) API account.
You run the following query against a container in the account.



What is the output of the query?

  1. [{"A": false, "B": true, "C": false}]
  2. [{"A": true, "B": false, "C": true}]
  3. [{"A": true, "B": true, "C": false}]
  4. [{"A": true, "B": true, "C": true}]

Answer(s): A

Explanation:

IS_NUMBER returns a Boolean value indicating if the type of the speci ed expression is a number.
"1234" is a string, not a number.


Reference:

https://docs.microsoft.com/en-us/azure/cosmos-db/sql/sql-query-is-number



You need to implement a trigger in Azure Cosmos DB Core (SQL) API that will run before an item is inserted into a container. Which two actions should you perform to ensure that the trigger runs? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.

  1. Append pre to the name of the JavaScript function trigger.
  2. For each create request, set the access condition in RequestOptions.
  3. Register the trigger as a pre-trigger.
  4. For each create request, set the consistency level to session in RequestOptions.
  5. For each create request, set the trigger name in RequestOptions.

Answer(s): C

Explanation:

C: When triggers are registered, you can specify the operations that it can run with.
F: When executing, pre-triggers are passed in the RequestOptions object by specifying PreTriggerInclude and then passing the name of the trigger in a List object.


Reference:

https://docs.microsoft.com/en-us/azure/cosmos-db/sql/how-to-use-stored-procedures-triggers-udfs



HOTSPOT (Drag and Drop is not supported).
You have a container in an Azure Cosmos DB Core (SQL) API account.
You need to use the Azure Cosmos DB SDK to replace a document by using optimistic concurrency. What should you include in the code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: ConsistencyLevel
The ItemRequestOptions Class ConsistencyLevel property gets or sets the consistency level required for the request in the Azure Cosmos DB service.
Azure Cosmos DB offers 5 different consistency levels. Strong, Bounded Staleness, Session, Consistent Pre x and Eventual - in order of strongest to weakest consistency.

Box 2: _etag
The ItemRequestOptions class helped us implement optimistic concurrency by specifying that we wanted the SDK to use the If-Match header to allow the server to decide whether a resource should be updated. The If-Match value is the ETag value to be checked against. If the ETag value matches the server ETag value, the resource is updated.


Reference:

https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.itemrequestoptions https://cosmosdb.github.io/labs/dotnet/labs/10- concurrency-control.html






Post your Comments and Discuss Microsoft DP-420 exam prep with other Community members:

DP-420 Exam Discussions & Posts