exam questions

Exam DP-420 All Questions

View all questions & answers for the DP-420 exam

Exam DP-420 topic 1 question 20 discussion

Actual exam question from Microsoft's DP-420
Question #: 20
Topic #: 1
[All DP-420 Questions]

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?

  • A. In a directory container, create a document for each company and a document for each user. Use the company ID as the partition key.
  • B. 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.
  • C. 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.
  • D. In a company container, create a document for each company. Embed the users into company documents. Use the company ID as the partition key.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
arnabdt
Highly Voted 1 year, 4 months ago
Selected Answer: B
B. 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. This design separates the users and companies into two different containers, with each container optimized for querying their respective entities. The user container uses the user ID as the partition key, which allows for efficient retrieval of individual users. The company container uses the company ID as the partition key, which enables efficient retrieval of all users associated with a particular company. Adding the company ID to each user document in the user container allows for easy and fast querying of users by company. Whenever a company or user profile is selected, the details page for the company and all related users can be retrieved by joining the data from the two containers using the company ID. This design meets all the requirements specified in the prompt, including efficient reading of data, browsing by company, and browsing users by company.
upvoted 12 times
xRiot007
8 months ago
The filter for both queries is company ID. B would result in cross partition queries with are not optimized for reading. A is the correct answer - one container, company ID as partition key and you can distinguish users from companies using a type prop, so if I only care to browse for a company I will not retrieve all its users because that would be extra data irrelevant for my search.
upvoted 7 times
...
...
Zyo
Highly Voted 1 year ago
1000 users with more than 2kb data can still exceed the 2MB allowed document size (dont forgot the company itself has data), so D is obviously incorrect.
upvoted 12 times
...
szkielet
Most Recent 5 days, 16 hours ago
Selected Answer: D
Somebody has mention the limit.. But the limit of the document is up to 2MB not 2KB https://learn.microsoft.com/en-us/azure/cosmos-db/concepts-limits
upvoted 1 times
...
szkielet
2 weeks, 5 days ago
Selected Answer: A
definitely A
upvoted 1 times
...
biglebowski88
2 months, 1 week ago
Selected Answer: A
I've changed my mind to A. A would not have the risk of hitting the 2mb size limit whilst also maintaining in partition queries based on the companyID partition key.
upvoted 1 times
...
biglebowski88
2 months, 1 week ago
Selected Answer: D
D. Last statement says it should be optimized for reads. reads with embedded documents is most efficient and less compute resource intensive.
upvoted 1 times
...
[Removed]
5 months, 3 weeks ago
Selected Answer: B
option B is the most suitable design to optimize the data store for reading data Partitioning data based on the company ID for companies and the user ID for users allows for efficient retrieval of data. When querying for a specific company or user, the partition key helps direct the query to the appropriate partition, minimizing the amount of data that needs to be scanned.
upvoted 1 times
...
monniq
11 months ago
Selected Answer: A
A is correct, since the company and users will be in the same partition ang can be retrived in an optimized way. You can use type property to query for the companies only, or users only. B is incorrect since users are partioned by userid and when retrieving users for a company it will be a cross-partition query (not optimal way) D will create large company documents and it is not an optimal way again. C again is not an optimal way since the query to get user by company will run cross partition.
upvoted 7 times
...
Womapoc
1 year ago
Selected Answer: D
D is correct
upvoted 2 times
...
akash211
1 year ago
B seems to be more optimized for reading data
upvoted 2 times
...
vinayhat
1 year ago
none of the options address "Associate each user to only one company". Ideally there should be a hierarchical key of userid / companyid to meet this requirement
upvoted 1 times
...
wojteksc
1 year, 1 month ago
Selected Answer: D
Option D provides a well-optimized data store design that enables efficient browsing and retrieval of data by company, as well as an easy way to view company details and associated users on a single page.
upvoted 8 times
...
TRUESON
1 year, 4 months ago
A is correct … We want users and companies on the same partition. This is done by using company id as partition key for both. As a compayid is a widely used filter thes data that are related can be covered from the same partition. we add a type pro to distinguish the two types
upvoted 8 times
...
imando
1 year, 4 months ago
Selected Answer: D
D is correct answer. Googled other sites and they are showing D as answer.
upvoted 6 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago