exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 4 question 34 discussion

Actual exam question from Microsoft's AZ-204
Question #: 34
Topic #: 4
[All AZ-204 Questions]

HOTSPOT -
You have an Azure Web app that uses Cosmos DB as a data store. You create a CosmosDB container by running the following PowerShell script:
$resourceGroupName = "testResourceGroup"
$accountName = "testCosmosAccount"
$databaseName = "testDatabase"
$containerName = "testContainer"
$partitionKeyPath = "/EmployeeId"
$autoscaleMaxThroughput = 5000

New-AzCosmosDBSqlContainer -
-ResourceGroupName $resourceGroupName
-AccountName $accountName
-DatabaseName $databaseName
-Name $containerName
-PartitionKeyKind Hash
-PartitionKeyPath $partitionKeyPath
-AutoscaleMaxThroughput $autoscaleMaxThroughput
You create the following queries that target the container:
SELECT * FROM c WHERE c.EmployeeId > '12345'
SELECT * FROM c WHERE c.UserID = '12345'
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: No -
You set the highest, or maximum RU/s Tmax you don't want the system to exceed. The system automatically scales the throughput T such that 0.1* Tmax <= T <=
Tmax.
In this example we have autoscaleMaxThroughput = 5000, so the minimum throughput for the container is 500 R/Us.

Box 2: No -
First query: SELECT * FROM c WHERE c.EmployeeId > '12345'
Here's a query that has a range filter on the partition key and won't be scoped to a single physical partition. In order to be an in-partition query, the query must have an equality filter that includes the partition key:
SELECT * FROM c WHERE c.DeviceId > 'XMS-0001'

Box 3: Yes -
Example of In-partition query:
Consider the below query with an equality filter on DeviceId. If we run this query on a container partitioned on DeviceId, this query will filter to a single physical partition.
SELECT * FROM c WHERE c.DeviceId = 'XMS-0001'
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-choose-offer https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-query-container

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
aradice
Highly Voted 3 years, 4 months ago
correct: 1° no => line 6 2° no => https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-choose-offer#overview-of-provisioned-throughput-types https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-query-container#in-partition-query "Here's a query that has a range filter on the partition key and won't be scoped to a single physical partition. In order to be an in-partition query, the query must have an equality filter that includes the partition key: SELECT * FROM c WHERE c.DeviceId > 'XMS-0001'" 3° : yes => partition key is EmployeeId. https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-query-container#cross-partition-query
upvoted 44 times
xRiot007
2 years, 8 months ago
The documentation on the second point could be better. They put the most important part at the end and that is that even if the query uses the partition key it MUST use an equality filter to be considered in-partition.
upvoted 3 times
...
finnishr
3 years, 2 months ago
100% correct!
upvoted 2 times
...
...
HimanshuNankani
Highly Voted 3 years ago
1. No : Because as question specifies max RUs = 5000, so minimum RUs = 5000/10 = 500 https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-choose-offer#overview-of-provisioned-throughput-types 2. No : In-partition query needs equality filter that is missing here 3. Yes: Though we have equality filter here, 'UserId' is not a partition key here. https://docs.microsoft.com/en-us/azure/cosmos-db/sql/how-to-query-container
upvoted 27 times
...
neelkanths
Most Recent 6 months, 1 week ago
Got it on 20 April 2024...Marks > 900...All questions from examtopics 400 questions... answer is correct...
upvoted 2 times
...
FeriAZ
9 months, 3 weeks ago
Minimum Throughput for the Container is 400 R/Us: Answer: No. In Cosmos DB, the minimum throughput for a container with autoscale is 10% of the maximum throughput. Since the maximum is set to 5000 RUs, the minimum would be 500 RUs (10% of 5000). The First Query Statement is an In-Partition Query: Answer: No. Though it filters on the partition key, it uses a range condition, potentially involving multiple partitions. The Second Query Statement is a Cross-Partition Query: Answer: Yes. It filters on a non-partition key (UserID), necessitating a scan across multiple partitions.
upvoted 5 times
...
bgbgvfvf
10 months, 2 weeks ago
Given answers are correct
upvoted 1 times
...
lednari
11 months ago
Y, N, Y Min is 400 RUs. (5000/100 = 50 which is smaller than 400) https://learn.microsoft.com/en-us/azure/cosmos-db/concepts-limits#minimum-throughput-on-container
upvoted 2 times
...
leviatas
1 year, 1 month ago
Got this question in my exam 2023.09.25. Had contoso Case Study
upvoted 2 times
...
applepie
1 year, 3 months ago
got this question today, answer NNY- 7/30/2023, score 895/1000
upvoted 2 times
...
NightshadeRC
1 year, 3 months ago
Had this question in today's exam: 2023-07-26
upvoted 2 times
...
[Removed]
1 year, 7 months ago
Got this in exam today (5 April 2023)
upvoted 3 times
...
Saluk_DE
1 year, 7 months ago
Question was on exam 2023-03-30
upvoted 1 times
...
proffesormuffin
1 year, 8 months ago
400 looks correct to me. "To estimate the minimum throughput required of a container with manual throughput, find the maximum of: 400 RU/s Current storage in GB * 1 RU/s Highest RU/s ever provisioned on the container / 100" 5000/100 = 50 not 500 so MAX( 400 ,50) = 400 ? https://learn.microsoft.com/en-us/azure/cosmos-db/concepts-limits
upvoted 2 times
Xardas
1 year, 3 months ago
Highest RU/s ever provisioned on the container * 0.1 = 500
upvoted 1 times
Xardas
1 year, 3 months ago
This link says formula is max * 0.1 https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-choose-offer#overview-of-provisioned-throughput-types But this link says it is max / 100 https://learn.microsoft.com/en-us/azure/cosmos-db/concepts-limits Which is right????
upvoted 1 times
stlim83
8 months ago
'max / 100', this one is for the manual throughput. 'max / 10', this is for the autoscale throughput.
upvoted 1 times
...
...
...
...
mabdo
1 year, 9 months ago
on 2/23
upvoted 2 times
...
Esward
1 year, 9 months ago
Given answers are correct.
upvoted 1 times
...
gmishra88
2 years, 1 month ago
First option is a question that punishes people who tried to set the RUs and remembered 400 RU as the minimum. If you never tried, you will find some relation with 5000 and 10% is a nice relation.
upvoted 3 times
proffesormuffin
1 year, 8 months ago
it's 1% not 10% so max 400,50 is 400. https://learn.microsoft.com/en-us/azure/cosmos-db/concepts-limits
upvoted 1 times
fuji36850
6 months, 1 week ago
I think you looked on wrong part of the doc, in 'autoscale' (mentioned in question) it is 10%
upvoted 1 times
...
...
...
[Removed]
2 years, 1 month ago
Answer No, No, Yes, got this in the cosmos dp-420 exam
upvoted 1 times
...
Azprep
2 years, 7 months ago
No, No, Yes
upvoted 2 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