DP-420 Practice Test practice questions, page 4 of 11, with answer review and explanations.
Question 16
You have a database named db1 in an Azure Cosmos DB Core (SQL) API account. You are designing an application that will use db1. In db1, you are creating a new container named coll1 that will store online orders. The following is a sample of a document that will be stored in coll1. The application will have the following characteristics: ✑ New orders will be created frequently by different customers. ✑ Customers will often view their past order history. You need to select the partition key value for coll1 to support the application. The solution must minimize costs. To what should you set the partition key?
orderId
customerId
orderDate
id
Question 17
You have a container in an Azure Cosmos DB Core (SQL) API 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 their 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.
You will exceed the maximum number of partition key values
You will exceed the maximum storage per partition
There will always be a hot partition
Queries will run cross-partition
Question 18
You have a container in an Azure Cosmos DB Core (SQL) API account. The container stores data about families. Data about parents, children, and pets are stored as separate documents. Each document contains the address of each family. Members of the same family share the same partition key named familyId. You need to update the address for each member of the same family that share the same address. The solution must meet the following requirements: ✑ Be atomic, consistent, isolated, and durable (ACID). ✑ Provide the lowest latency. What should you do?
Update the document of each family member separately by using a patch operation
Update the document of each family member separately and set the consistency level to strong
Update the document of each family member by using a transactional batch operation
Question 19
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?
Create a new synthetic key that contains deviceId and timestamp
Use timestamp as the partition key
Use deviceManufacturer as the partition key
Use sensor1Value as the partition key
Question 20
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: ✑ Store companies and the users employed by them. Each company will have less than 1,000 users. ✑ Some users have data that is greater than 2 KB. ✑ Associate each user to only one company. ✑ Provide the ability to browse by company. ✑ Provide the ability to browse the users by company. ✑ Whenever a company or user profile is selected, show a details page for the company and all the related users. ✑ Be optimized for reading data. Which design should you implement to optimize the data store for reading data?
In a directory container, create a document for each company and a document for each user. Use the company ID as the partition key.
Create a user container that uses the user ID as the partition key and a company container that uses the company ID as the partition key. Add the company ID to each user document.
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.
In a company container, create a document for each company. Embed the users into company documents. Use the company ID as the partition key.