ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 129 - AZ-204 discussion

Report
Export

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.


Question 129
Correct answer: Question 129

Explanation:

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

asked 02/10/2024
Markus Hechtl
35 questions
User
0 comments
Sorted by

Leave a comment first