Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB
Exam Details
Exam Code
:DP-420
Exam Name
:Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB
Certification
:Microsoft Certifications
Vendor
:Microsoft
Total Questions
:158 Q&As
Last Updated
:Mar 23, 2025
Microsoft Microsoft Certifications DP-420 Questions & Answers
Question 41:
You need to create a data store for a directory of small and medium-sized businesses (SMBs). The data store must meet the following requirements:
1.
Store companies and the users employed by them. Each company will have less than 1,000 users.
2.
Some users have data that is greater than 2 KB.
3.
Associate each user to only one company.
4.
Provide the ability to browse by company.
5.
Provide the ability to browse the users by company.
6.
Whenever a company or user profile is selected, show a details page for the company and all the related users.
7.
Be optimized for reading data.
Which design should you implement to optimize the data store for reading data?
A. In a directory container, create a document for each company and a document for each user. Use company ID as the partition key.
B. In a company container, create a document for each company. Embed the users into company documents. Use the company ID as the partition key.
C. Create a user container that uses the user ID as the partition key and a company container that container that uses the company ID as the partition key. Add the company ID to each user documents.
D. In a user container, create a document for each user. Embed the company into each user document. Use the user ID as the partition key.
Correct Answer: B
Azure Cosmos DB is a multi-model database that supports various data models, such as documents, key-value, graph, and column-family3. The core content-model of Cosmos DB's database engine is based on atom-record-sequence
(ARS), which allows it to store and query different types of data in a flexible and efficient way3. To optimize the data store for reading data, you should consider the following factors:
The size and shape of your data
The frequency and complexity of your queries
The latency and throughput requirements of your application The trade-offs between storage efficiency and query performance
Based on these factors, one possible design that you could implement is B. In a company container, create a document for each company. Embed the users into company documents. Use the company ID as the partition key.
This design has the following advantages:
It stores companies and users as self-contained documents that can be easily retrieved by company ID1.
It avoids storing redundant data or creating additional containers for users1. It allows you to browse by company and browse the users by company with simple queries1.
It shows a details page for the company and all the related users by fetching a single document1.
It leverages the benefits of embedding data, such as reducing the number of requests, improving query performance, and simplifying data consistency2.
This design also has some limitations, such as:
It may not be suitable for some users who have data that is greater than 2 KB, as it could exceed the maximum document size limit of 2 MB2. It may not be optimal for scenarios where users need to be associated with more than one
company or queried independently from companies2. It may not be scalable for companies that have more than 1,000 users, as it could result in hot partitions or throttling2. Depending on your specific use case and requirements, you may
need to adjust this design or choose a different one. For example, you could use a hybrid data model that combines embedding and referencing data2, or you could use a graph data model that expresses entities and relationships as vertices
and edges.
Question 42:
You have an Azure Cosmos DB for NoSQL account that has multiple write regions.
You need to receive an alert when requests that target the database exceed the available request units per second (RU/s).
Which Azure Monitor signal should you use?
A. Region Removed
B. Document Quota
C. Metadata Requests
D. Data Usage
Correct Answer: B
Azure Monitor is a service that provides comprehensive monitoring for Azure resources, including Azure Cosmos DB. You can use Azure Monitor to collect, analyze, and alert on metrics and logs from your Azure Cosmos DB account. You can create alerts for Azure Cosmos DB using Azure Monitor based on the metrics, activity log events, or Log Analytics logs on your account1. For your scenario, if you want to receive an alert when requests that target the database exceed the available request units per second (RU/s), you should use the Document Quota metric. This metric measures the percentage of RU/s consumed by your account or container. You can create an alert rule on this metric from the Azure portal by following these steps2: In the Azure portal, select the Azure Cosmos DB account you want to monitor. Under the Monitoring section of the sidebar, select Alerts, and then select New alert rule. In the Create alert rule pane, fill out the Scope section by selecting your subscription name and resource type (Azure Cosmos DB accounts). In the Condition section, select Add condition and choose Document Quota from the list of signals. In the Configure signal logic pane, specify the threshold value and operator for your alert condition. For example, you can choose Greater than or equal to 90 as the threshold value and operator to receive an alert when your RU/s consumption reaches 90% or more of your provisioned throughput. In the Alert rule details section, specify a name and description for your alert rule. In the Actions section, select Add action group and choose how you want to receive notifications for your alert. For example, you can choose Email/SMS/Push/Voice as an action type and enter your email address or phone number as a receiver. Review your alert rule settings and select Create alert rule to save it.
Question 43:
You have an Azure Cosmos DB for NoSQL account named account1 that supports an application named App1. App1 uses the consistent prefix consistency level.
You configure account1 to use a dedicated gateway and integrated cache.
You need to ensure that App1 can use the integrated cache.
Which two actions should you perform for APP1? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
A. Change the connection mode to direct
B. Change the account endpoint to https://account1.sqlx.cosmos.azure.com.
C. Change the consistency level of requests to strong.
D. Change the consistency level of requests to session.
E. Change the account endpoint to https://account1.documents.azure.com
Correct Answer: BD
the Azure Cosmos DB integrated cache is an in-memory cache that is built- in to the Azure Cosmos DB dedicated gateway. The dedicated gateway is a front-end compute that stores cached data and routes requests to the backend database.
You can choose from a variety of dedicated gateway sizes based on the number of cores and memory needed for your workload1. The integrated cache can reduce the RU consumption and latency of read operations by serving them from
the cache instead of the backend containers2.
For your scenario, to ensure that App1 can use the integrated cache, you should perform these two actions:
Change the account endpoint to https://account1.sqlx.cosmos.azure.com. This is the dedicated gateway endpoint that you need to use to connect to your Azure Cosmos DB account and leverage the integrated cache. The standard gateway
endpoint (https://account1.documents.azure.com) will not use the integrated cache2.
Change the consistency level of requests to session. This is the highest consistency level that is supported by the integrated cache. If you use a higher consistency level (such as strong or bounded staleness), your requests will bypass the
integrated cache and go directly to the backend containers
Question 44:
You have an Azure Cosmos DB account named account1.
You have several apps that connect to account1 by using the account's secondary key.
You then configure the apps to authenticate by using service principals.
You need to ensure that account1 will only allow apps to connect by using an Azure AD identity.
Which account property should you modify?
A. disableKeyBasedMetadataWriteAccess ,
B. disableLocalAuth
C. userAssignedldentatxe
D. allowedOrxgins
Correct Answer: B
The disableLocalAuth property is a boolean flag that indicates whether local authentication methods such as primary/secondary keys are disabled for the Azure Cosmos DB account. Setting this property to true improves security by ensuring that Azure Cosmos DB accounts exclusively require Azure Active Directory identities for authentication1.
Question 45:
You have an Azure Cosmos DB database named databaset contains a container named container1. The container1 container store product data and has the following indexing policy.
Which path will be indexed?
A. /product/brand
B. /product/category
C. /product/[ ]/category
D. /product/brand/tailspin
Correct Answer: A
The indexing policy has an includedPaths array that contains only one path:
/product/brand/ . This means that only the properties under /product/brand will be indexed.
The symbol indicates that only scalar values will be indexed, not arrays or objects1.
The excludedPaths array contains a single path: /* .
This means that all other properties will be excluded from indexing.
The * symbol indicates a wildcard that matches any property name1.
Therefore, the paths /product/category , /product/[ ]/category , and /product/brand/tailspin will not be indexed.
Question 46:
You have a database in an Azure Cosmos DB for NoSQL account that is configured for multi-region writes.
You need to use the Azure Cosmos DB SDK to implement the conflict resolution policy for a container. The solution must ensure that any conflict sent to the conflict feed.
Solution:
1.
You set ConfilictResolutionMode to Custom.
2.
You Set ResolutionProcedures to a custom stored procedure.
3.
You configure the custom stored procedure to use the isTomstone parameter to resolve conflict.
Does this meet the goal?
A. Yes
B. No
Correct Answer: A
The solution is incorrect because there is no "isTom" parameter in the Azure Cosmos DB SDK. The correct parameter is "isTombstone".
Question 47:
You have operational data in an Azure Cosmos OB for NoSQL database.
Database users report that the performance of the database degrades significantly when a business analytics team runs large Apache Spark-based queries against the database.
You need 10 reduce the impact that running the Spark-based queries has on the database users.
What should you implement?
A. Azure Synapse Link
B. a default consistency level of Consistent Prefix
C. a default consistency level of Strong
D. the Spark connector
Correct Answer: A
Question 48:
You have an Azure Cosmos DB for NoSQL account.
The change feed is enabled on a container named invoice.
You create an Azure function that has a trigger on the change feed.
What is received by the Azure function?
A. all the properties of the updated items
B. only the partition key and the changed properties of the updated items
C. all the properties of the original items and the updated items
D. only the changed properties and the system-defined properties of the updated items
Correct Answer: A
According to the Azure Cosmos DB documentation12, the change feed is a persistent record of changes to a container in the order they occur. The change feed outputs the sorted list of documents that were changed in the order in which
they were modified.
The Azure function that has a trigger on the change feed receives all the properties of the updated items2. The change feed does not include the original items or only the changed properties. The change feed also includes some system-
defined properties such as _ts (the last modified timestamp) and _lsn (the logical sequence number)3.
Therefore, the correct answer is "all the properties of the updated items"
Question 49:
You have an Azure Cosmos DB for NoSQL account named account1 that has a single read-write region and one additional read region.
Account1 uses the strong default consistency level.
You have an application that uses the eventual consistency level when submitting requests to account1.
How will writes from the application be handled?
A. Writes will use the strong consistency level.
B. Azure Cosmos DB will reject writes from the application.
C. The write order is not guaranteed during replication.
D. Writes will use the eventual consistency level.
Correct Answer: A
This is because the write concern is mapped to the default consistency level configured on your Azure Cosmos DB account, which is strong in this case. Strong consistency ensures that every write operation is synchronously committed to every region associated with your Azure Cosmos DB account. The eventual consistency level that the application uses only applies to the read operations. Eventual consistency offers higher availability and better performance, but it does not guarantee the order or latency of the reads.
Question 50:
You have a container in an Azure Cosmos DB for NoSQL account that stores data about orders. The following is a sample of an order document.
Documents are up to 2 KB.
You plan to receive one million orders daily.
Customers will frequently view then past order history.
You are the evaluating whether to use orderDate as the partition key.
What are two effects of using orderDate as the partition key? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
A. You will exceed the maximum number of partition key values.
B. Queries will run cross-partition.
C. You will exceed the maximum storage per partition.
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Microsoft exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your DP-420 exam preparations and Microsoft certification application, do not hesitate to visit our Vcedump.com to find your solutions here.