Microsoft DP-420 Azure Cosmos DB Developer 1-10

表示モード
画像位置
文字位置
理解度の自動記録
STATUS FILTER

Choose confidence levels to display

Loading...
Q1DP-420
Column name Data type Data length (bytes)
Car brand String 30
Car model String 30
Model year Integer 4
Part name String 50
Part description String 500
Storage location String 50
Car brand Car model Model year Part name Storage location Part description
Ford Escort 1999 Door handle Shelf 5, Bin 3 Description 1
Ford Escort 2000 Door handle Shelf 5, Bin 5 Description 2
Ford Escort 2001 Door handle Shelf 32, Bin 17 Description 3
Ford Escape 1999 Door handle Shelf 43, Bin 12 Description 4
Chevrolet Beiser 1975 Door handle Shelf 19, Bin 12 Description 5
Chevrolet Bolt 2024 Trunk release Shelf 20, Bin 17 Description 6
Physical partition key

Logical partition key

Show answer
Correct answer: Model year / Car model

Model year has five distinct values in the sample data and a higher cardinality than brand or part name, so it distributes writes broadly and suppresses I/O contention and hot partitions.
This makes Model year a good choice for the physical partition key.
Choosing Car model as the logical partition key lets you further subdivide items of the same model year by car model, and the combination of model year and car model is unique in the sample data.
In Azure Cosmos DB, logical partitions are formed by the partition key value, and the service automatically manages their placement onto physical partitions.
Therefore, it is important to choose a key that distributes both data and requests evenly.
Partitioning and horizontal scaling in Azure Cosmos DB

Q2DP-420
Show answer
Correct answer: D. A pre-trigger

A pre-trigger runs before a database item is modified, so it can throw a JavaScript exception before the delete is processed, abort the operation, and return an error to App1.
A post-trigger runs after the change, and a UDF is used mainly for computations within queries, so neither is suited to this purpose.
Triggers do not run automatically, so App1 must explicitly specify the pre-trigger when it issues the delete request.
Note that the “document” in the question is now referred to mainly as an “item” in current Microsoft official documentation.
How to write stored procedures, triggers, and user-defined functions in Azure Cosmos DB

Q3DP-420
Scenario 1

Scenario 2

Show answer
Correct answer: Deploy the ARM template twice in incremental mode / Azure PowerShell

Adding or removing a region cannot be performed together with other property changes in the same deployment.
Therefore, in Scenario 1 you split adding the read region and increasing the RU/s into two incremental deployments.
Incremental mode does not delete existing resources that are not included in the template.
Migrating from manual throughput to autoscale is a POST operation and is not supported by ARM templates, so Scenario 2 uses Azure PowerShell.
Manage Azure Cosmos DB for NoSQL resources by using Azure Resource Manager templates
Azure Resource Manager deployment modes

Q4DP-420
Show answer
Correct answer: A. “connector.class”: “com.azure.cosmos.kafka.connect.source.CosmosDBSourceConnector”, C. “key.converter”: “io.confluent.connect.avro.AvroConverter”, D. “connect.cosmos.containers.topicmap”: “iot#telemetry”

To send data from Cosmos DB to Kafka, you use the CosmosDBSourceConnector.
A sink connector, conversely, is used when writing data from Kafka into Cosmos DB.
A compact binary format uses AVRO, so the AvroConverter is required.
Also, topicmap takes the form “Kafka topic name#Cosmos DB container name”, so it is set to iot#telemetry.
In a real configuration, you also need to check the value.converter for the data body and the schema registry settings.
Kafka Connect for Azure Cosmos DB
Kafka Connect for Azure Cosmos DB – source connector

Q5DP-420
Show answer
Correct answer: A. Embed the order details for each order within the same container as the order.

When orders and order details are always read together, a denormalized design that embeds the order details as an array within the order’s JSON item is appropriate.
The entire order can be retrieved in a single point read, avoiding queries across multiple items or multiple reads, which reduces latency and RU consumption.
Splitting into separate containers or separate items incurs additional requests or join processing.
Azure Cosmos DB for NoSQL is the current official name, changed from the former SQL API.
Data modeling in Azure Cosmos DB for NoSQL
Optimize request cost in Azure Cosmos DB

Q6DP-420
Show answer
Correct answer: B. High cardinality, D. Static

A high-cardinality key has many distinct values, so it distributes items across many fine-grained logical partitions and helps keep each partition small.
With low cardinality, many items risk being concentrated on the same key value.
A static key does not change its value, so it avoids deleting and re-creating items due to changes and reduces maintenance work.
In Azure Cosmos DB, you cannot change the partition key value of an existing item in place.
Partitioning and horizontal scaling in Azure Cosmos DB

Q7DP-420
Show answer
Correct answer: D. | where OperationName startswith “SqlContainersThroughputUpdate”

A throughput change on an Azure Cosmos DB for NoSQL container is recorded as a control plane operation whose OperationName starts with “SqlContainersThroughputUpdate”.
Therefore, adding D extracts the date and time when RU/s were changed.
RegionAddComplete represents adding a region, SqlContainersCreate represents creating a container, and MongoCollectionsThroughputUpdate represents a throughput change on a collection for the API for MongoDB.
AzureDiagnostics is now a legacy-mode common table, and newer configurations can also choose a resource-specific table, but this query uses AzureDiagnostics.
How to audit Azure Cosmos DB control plane operations
Monitor Azure Cosmos DB

Q8DP-420
Show answer
Correct answer: A. Yes

The first JOIN expands each element of the children array, so c.familyName retrieves the child’s last name.
The subsequent multi-value subquery narrows each child’s pets array to only the elements whose type is cat and returns their givenName as petName.
As a result, it retrieves the requested items of f.id, the child’s last name, and the cat’s name, so it meets the goal.
Current official documentation also supports self-joins within arrays and multi-value subqueries that filter an array before the JOIN.
Subquery – Cosmos DB query language (Azure and Fabric)
Self-join – Cosmos DB query language (Azure and Fabric)

Q9DP-420
Show answer
Correct answer: B. Azure Data Factory

With the copy activity in Azure Data Factory, you can use the REST connector as the source to retrieve data from a REST API and use the Azure Cosmos DB for NoSQL connector as the sink to write to the container.
Also, a schedule trigger lets you set a recurrence interval, so the pipeline can run automatically every week.
Azure Migrate is used mainly to migrate servers and similar resources to Azure, and the Database Migration Assistant targets assessment and migration of SQL Server-family workloads, so it is not suited to periodic REST integration.
Copy and transform data from and to a REST endpoint by using Azure Data Factory
Copy and transform data in Azure Cosmos DB for NoSQL by using Azure Data Factory

Q10DP-420
Statement Yes No
Deploying the template creates an Azure Cosmos DB account named acct01 if it does not already exist.
Deploying the template creates a container named mycontainer in mydb if it does not already exist.
Deploying the template changes the partition key of mycontainer to companyid if mycontainer exists and its partition key is name.
Show answer
Correct answer: Statement 1 “No” / Statement 2 “Yes” / Statement 3 “No”

The template defines only the container child resource, so the nonexistent acct01 account and mydb database are not created automatically.
If the parent resources already exist, the incremental deployment creates the not-yet-created mycontainer.
The partition key of an existing container cannot be changed directly from /name to /companyid; using a different partition key requires migrating data to a new container.
Microsoft.DocumentDB is still the official resource provider namespace used by Azure Cosmos DB.
Microsoft.DocumentDB databaseAccounts/sqlDatabases/containers
Set name and type for child resources