DP-203: Data Engineering on Microsoft Azure

44%

Question 201

You plan to implement an Azure Cosmos DB database that will write 100,000 JSON every 24 hours. The database will be replicated to three regions. Only one region will be writable.

You need to select a consistency level for the database to meet the following requirements:

Which consistency level should you select?
Strong
Bounded Staleness
Eventual
Session
Consistent Prefix




Answer is Session

Session: Within a single client session reads are guaranteed to honor the consistent-prefix (assuming a single “writer” session), monotonic reads, monotonic writes, read-your-writes, and write-follows-reads guarantees. Clients outside of the session performing writes will see eventual consistency.

References:
https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels

Question 202

You plan to deploy an Azure Cosmos DB database that supports multi-master replication.
You need to select a consistency level for the database to meet the following requirements:

What are three possible consistency levels that you can select?
Strong
Bounded Staleness
Eventual
Session
Consistent Prefix




Answers are Consistent Prefix, Eventual, Session


References:
https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels-choosing

Question 203

You have a container named Sales in an Azure Cosmos DB database. Sales has 120 GB of data. Each entry in Sales has the following structure.
{ OrderId: number, OrderDetailId: number, ProductName: string, other information that might vary... }
The partition key is set to the OrderId attribute.
Users report that when they perform queries that retrieve data by ProductName, the queries take longer than expected to complete.
You need to reduce the amount of time it takes to execute the problematic queries.

Solution: You create a lookup collection that uses ProductName as a partition key.

Does this meet the goal?
Yes
No




Answer is No

One option is to have a lookup collection “ProductName” for the mapping of “ProductName” to “OrderId”.

References:
https://azure.microsoft.com/sv-se/blog/azure-cosmos-db-partitioning-design-patterns-part-1/

Question 204

You have a container named Sales in an Azure Cosmos DB database. Sales has 120 GB of data. Each entry in Sales has the following structure.
{
	OrderId: number,
	OrderDetailId: number,
	ProductName: string,
	other information that might vary...
}

The partition key is set to the OrderId attribute.
Users report that when they perform queries that retrieve data by ProductName, the queries take longer than expected to complete.
You need to reduce the amount of time it takes to execute the problematic queries.

Solution: You create a lookup collection that uses ProductName as a partition key and OrderId as a value.

Does this meet the goal?
Yes
No




Answer is Yes

One option is to have a lookup collection “ProductName” for the mapping of “ProductName” to “OrderId”.

References:
https://azure.microsoft.com/sv-se/blog/azure-cosmos-db-partitioning-design-patterns-part-1/

Question 205

You have a container named Sales in an Azure Cosmos DB database. Sales has 120 GB of data. Each entry in Sales has the following structure.
{
   OrderId: number,
   OrderDetailId: number,
   ProductName: string,
   other information that might vary...
}
The partition key is set to the OrderId attribute.
Users report that when they perform queries that retrieve data by ProductName, the queries take longer than expected to complete.
You need to reduce the amount of time it takes to execute the problematic queries.
Solution: You increase the Request Units (RUs) for the database.

Does this meet the goal?
Yes
No




Answer is Yes

To scale the provisioned throughput for your application, you can increase or decrease the number of RUs at any time.

Note: The cost of all database operations is normalized by Azure Cosmos DB and is expressed by Request Units (or RUs, for short). You can think of RUs per second as the currency for throughput. RUs per second is a rate-based currency. It abstracts the system resources such as CPU, IOPS, and memory that are required to perform the database operations supported by Azure Cosmos DB.

Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/request-units

Question 206

You have a container named Sales in an Azure Cosmos DB database. Sales has 120 GB of data. Each entry in Sales has the following structure.
{
   OrderId: number,
   OrderDetailId: number,
   ProductName: string,
   other information that might vary...
}

The partition key is set to the OrderId attribute.
Users report that when they perform queries that retrieve data by ProductName, the queries take longer than expected to complete.
You need to reduce the amount of time it takes to execute the problematic queries.

Solution: You change the partition key to include ProductName.

Does this meet the goal?
Yes
No




Answer is No

Explanation:
One option is to have a lookup collection “ProductName” for the mapping of “ProductName” to “OrderId”.

References:
https://azure.microsoft.com/sv-se/blog/azure-cosmos-db-partitioning-design-patterns-part-1/

Question 207

You have an Azure Cosmos DB database that uses the SQL API.
You need to delete stale data from the database automatically.

What should you use?
soft delete
Low Latency Analytical Processing (LLAP)
schema on read
Time to Live (TTL)




Answer is Time to Live (TTL)

With Time to Live or TTL, Azure Cosmos DB provides the ability to delete items automatically from a container after a certain time period. By default, you can set time to live at the container level and override the value on a per-item basis. After you set the TTL at a container or at an item level, Azure Cosmos DB will automatically remove these items after the time period, since the time they were last modified.

References:
https://docs.microsoft.com/en-us/azure/cosmos-db/time-to-live

Question 208

You develop data engineering solutions for a company. An application creates a database on Microsoft Azure. You have the following code:

Which database and authorization types are used?
A-A
A-B
A-C
B-B
B-C
C-C
D-A
D-B





Box 1: Azure Cosmos DB
The DocumentClient.CreateDatabaseAsync(Database, RequestOptions) method creates a database resource as an asychronous operation in the Azure Cosmos DB service.

Box 2: Master Key
Azure Cosmos DB uses two types of keys to authenticate users and provide access to its data and resources: Master Key, Resource Tokens
Master keys provide access to the all the administrative resources for the database account. Master keys:
- Provide access to accounts, databases, users, and permissions.
- Cannot be used to provide granular access to containers and documents.
- Are created during the creation of an account.
- Can be regenerated at any time.

Incorrect Answers:
Resource Token: Resource tokens provide access to the application resources within a database.

References:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.client.documentclient.createdatabaseasync
https://docs.microsoft.com/en-us/azure/cosmos-db/secure-access-to-data

Question 209

You have an Azure Cosmos DB database.
You need to use Azure Stream Analytics to check for uneven distributions of queries that can affect performance.
Which two settings should you configure?
A-B
B-C
C-D
D-E
E-F
F-G
G-A




Answer is D - E

PartitionKeyStatistics: Select this option to log the statistics of the partition keys. This is currently represented with the storage size (KB) of the partition keys.

PartitionKeyRUConsumption: This log reports the aggregated per-second RU/s consumption of partition keys. Currently, Azure Cosmos DB reports partition keys for SQL API accounts only and for point read/write and stored procedure operations. other APIs and operation types are not supported. For other APIs, the partition key column in the diagnostic log table will be empty. This log contains data such as subscription ID, region name, database name, collection name, partition key, operation type, and request charge.

Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/cosmosdb-monitor-resource-logs

Question 210

A company is planning to use Microsoft Azure Cosmos DB as the data store for an application. You have the following Azure CLI command:
az cosmosdb create name cosmosdbdev1 -resource-group rgdev
You need to minimize latency and expose the SQL API. How should you complete the command?
A-B
B-C
C-C
D-B
A-A
B-A
C-A
D-C




Answer is C-C


Box 1: Eventual
With Azure Cosmos DB, developers can choose from five well-defined consistency models on the consistency spectrum. From strongest to more relaxed, the models include strong, bounded staleness, session, consistent prefix, and eventual consistency.

Box 2: GlobalDocumentDB
Select Core(SQL) to create a document database and query by using SQL syntax.
Note: The API determines the type of account to create. Azure Cosmos DB provides five APIs: Core(SQL) and MongoDB for document databases, Gremlin for graph databases, Azure Table, and Cassandra.

References:
https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels
https://docs.microsoft.com/en-us/azure/cosmos-db/create-sql-api-dotnet

< Previous PageNext Page >

Quick access to all questions in this exam