MeasureUp Questions Flashcards
Which ports must be open for a direct connection?
TCP 0-65535
What connection mode is the default for .NET SDK v3?
Direct Mode with TCP
Can you use EF Core to generate unique id’s for Cosmos documents?
Yes.
Generate the value by concatenating the discriminator and the primary key values. You have to use ‘|’ as a delimiter.
Which two properties cannot be encrypted with a Customer Managed Key (CMK)?
Id and Partition Key
What actions can the role with id 00000000-0000-0000-0000-000000000001 perform?
The ID is Azure Cosmos DB Built-in Data Reader role.
Microsoft.DocumentDB/databaseAccounts/readMetadata
Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read
Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/executeQuery
Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/readChangeFeed
What status code will you get if you try to read a change feed with no new changes?
HttpStatusCode.NotModified
You have created a pre-trigger in Azure Cosmos DB Core (SQL) API using the .NET SDK version3 for one of your applications that uses Azure Cosmos DB as a data source.
Your organizational security policy requires you to provide the ability for specific clients to read resources in your Cosmos DB account without requiring the explicit usage of a primary key.
You need to provide fine-grained access to specific users for this pre-trigger in a time-bound manner with a customized validity period.
What should you use to achieve the requirement?
You should use resource tokens.
Resource tokens allow you to provide fine-grained access to specific application resources within an Azure Cosmos DB database. They include providing access to specific containers, partition keys, items (or documents), stored procedures, pre-triggers, post-triggers, and user-defined functions (UDFs). Additionally, resource tokens allow you to provide access to the above-mentioned resources in a time-bound manner with a customized validity period without the explicit requirement of a primary or read-only key.
How much will the RUs increase for point reads when using Always Encrypted?
5 %
How much will the RUs increase when reading an Azure Cosmos DB Change Feed increase when using Always Encrypted?
15 %
How much will queries increase RUs when using Always Encrypted?
15 %
How much will write operations increase RUs when using Always Encrypted?
6 %
What is a common reason for an HTTP 423 status response when trying to change thruput?
Another scaling operation is in progress
Does resolved conflicts show up in the Cosmos DB conflict feed?
No
At what level do you need to assign the Cosmos DB Operator role for a user to configure Backup & Restore?
Subscription level
What is the default redundancy level for periodic backups?
Geo-redundant, if the regions supports it.
Can you get help from Azure Support to restore a database if you have the Basic Support Plan?
No
What Azure Support plan do you need to call and restore databases from backup?
Standard or Developer Plan or higher
What connectivity mode is best when the environment has a high connection limit?
Direct connections
Is it possible to change consistency level to strong for a multi-region multi-write deployment?
No
How can you optimize provisioned thruput (RUs) in the read regions using an effective strategy?
Use Cosmos DB CHange Feed to move over-utilized resd requests to a regions where read requests are under-utlized
Can Public DNS resolve Private Link endpoints?
No
What can you use to change between autoscale and manual provisioned account?
CLI / PowerShell
Can ARM templates or Bicep templates change autoscale / provisioning for an account?
No, need to use CLI / PowerShell
What is the recommended replication factor when the existing data-bearing replica set is unknown
3
What is the recommended formula for estinating RU/s for Cosmos SQL api?
C (600 RU/s/vCore) * T (total vCores/vCPU) / R (replication factor for existing replica set)
When should you avoid using Dedicated Gateway to approve performance for queries and point reads?
When using private IP addesses using a Private Link
What syntax should you use to index only the nutritionValue property of this array:
“nutrients”: [
{
“id”: “203”,
“description”: “Protein”,
“nutritionValue”: 1.82,
“units”: “g”
},
…
]
]
“/nutrients/[]/nutritionValue/*
You should choose the “/nutrients/[]/nutritionValue/*” option. This is the correct syntax for specifically indexing the nutritionValue path within the nutrition array, which is the desired outcome.
How many containers can a serverless database deployment host with shared throughput?
25
The default consistency level for the account is Session. Can the request option set a more strict level, like Strong?
No
The default consistency level for the account is Session. Can the request option set a more lax level, like Eventual?
Yes
Can you change a conflict resolution policy for an existing container?
No
What must you use to have a custom resolution policy?
Stored Procedure
How do you define a custom resolution policy?
Use ConflictResolutionPolicy with a Mode = Custom and a ResolutionProcedure = and when creating the container.
What should you do to capture query index performance?
Enable PopulateIndexMetrics in QueryRequestOptions. Then get IndexMetrics from the response object.
QueryRequestOptions options = new() { PopulateIndexMetrics = true };
What must you do in order to use a dedicated gateway?
- Enable it
- Use the dedicated gateway connection string instead of the typical connection string
- Use Gateway mode instead of the default Direct connectivity mode
- The client’s consistency level must be set to session or eventual
When is a dedicated gateway most useful?
- Workloads with far more read operations and queries than write operations
- Workloads that read large individual items multiple times
- Workloads that execute queries multiple times with a large amount of RU/s
- Workloads that have hot partition key[s] for read operations and queries
What does the sqlx in the .sqlx.cosmos.azure.com connection domain indicate?
It’s a connection string to a dedicated gateway.
What is a normal rate of errors with status code 429?
About 5 %
What could be the reason for a high number of 429 errors?
Hot partitions
How do you identify hot partitions in Cosmos DB Portal?
Insights->Throughput, review the Normalized RU Consumption (%) By PartitionKeyRangeID charts.
What is the cause of an http status 409 error when creating a new document?
The id already exists.
What is the cause of an http status 413 error?
Document size is too large
What diagnostics category is “partitionkeyrangeid” part of?
QueryRuntimeStatistics
What diagnostics category is “requestCharge” part of?
PartitionKeyRUConsumption
What six properties will DataPlaneRequests diagnostics category capture?
Requestcharge,
statusCode,
clientIPaddress,
partitionID,
resourceTokenPermissionId, resourceTokenPermissionMode
What diagnostics category will capture logical partition storage skew?
PartitionKeyStatistics