The following is a sample of a document in orders.The orders container uses customerId as the partition key.You need to provide a report of the total items ordered per month by item type. The solution must meet the following requirements:-Ensure that the report can run as quickly as possible.-Minimize the consumption of request units (RUs).What should you do?
Answer(s): B
You can facilitate aggregate data by using Change Feed and Azure Functions, and then use it for reporting.
https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed
HOTSPOT (Drag and Drop is not supported)You have three containers in an Azure Cosmos DB Core (SQL) API account as shown in the following table.You have the following Azure functions:-A function named Fn1 that reads the change feed of cn1-A function named Fn2 that reads the change feed of cn2-A function named Fn3 that reads the change feed of cn3You perform the following actions:-Delete an item named item1 from cn1.-Update an item named item2 in cn2.-For an item named item3 in cn3, update the item time to live to 3,600 seconds.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:
Answer(s): A
Box 1: NoAzure Cosmos DB's change feed is a great choice as a central data store in event sourcing architectures where all data ingestion is modeled as writes (no updates or deletes).Note: The change feed does not capture deletes. If you delete an item from your container, it is also removed from the change feed. The most common method of handling this is adding a soft marker on the items that are being deleted. You can add a property called "deleted" and set it to "true" at the time of deletion. This document update will show up in the change feed. You can set a TTL on this item so that it can be automatically deleted later.Box 2: NoThe _etag format is internal and you should not take dependency on it, because it can change anytime.Box 3: YesChange feed support in Azure Cosmos DB works by listening to an Azure Cosmos container for any changes.
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/change-feed-design-patterns https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed
HOTSPOT (Drag and Drop is not supported)You configure Azure Cognitive Search to index a container in an Azure Cosmos DB for NoSQL account as shown in the following exhibit.Use the drop-down menus to select the answer choice that completes each statement based on the information presented in the graphic.Note: Each correct selection is worth one point.Hot Area:
Box 1: countryThe country field is filterable.Note: filterable: Indicates whether to enable the field to be referenced in $filter queries. Filterable differs from searchable in how strings are handled. Fields of type Edm.String or Collection(Edm.String) that are filterable do not undergo lexical analysis, so comparisons are for exact matches only.Box 2: nameThe name field is not Retrievable.Retrievable: Indicates whether the field can be returned in a search result. Set this attribute to false if you want to use a field (for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user.Note: searchable: Indicates whether the field is full-text searchable and can be referenced in search queries.
https://docs.microsoft.com/en-us/rest/api/searchservice/create-index
Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.You have a container named container1 in an Azure Cosmos DB Core (SQL) API account.You need to make the contents of container1 available as reference data for an Azure Stream Analytics job.Solution: You create an Azure function that uses the Azure Cosmos DB for NoSQL change feed as a trigger and Azure event hub as the output.Does this meet the goal?
Correct:* You create an Azure function that uses Azure Cosmos DB for NoSQL change feed as a trigger and Azure event hub as the output.Correct if the wording says that an Azure Cosmos DB for NoSQL account is used.Use an Azure Function, not a pipeline.Use a change feed as a trigger, not doing a copy.The Function uses an Azure Cosmos DB for NoSQL change feed as specified, not Azure Cosmos DB Core (SQL) API change feed change feed.As output use an Azure event hub.* You create an Azure function that uses Azure Cosmos DB Core (SQL) API change feed as a trigger and Azure event hub as the output.Correct as per same logic, if the wording says that an Azure Cosmos DB Core (SQL) API account is used.Incorrect:* You create an Azure Data Factory pipeline that uses Azure Cosmos DB Core (SQL) API as the input and Azure Blob Storage as the output.Use a function, not a pipeline.* You create an Azure Data Factory pipeline that uses Azure Cosmos DB for NoSQL as the input and Azure Blob Storage as the output.Use a function, not a pipeline.* You create an Azure function to copy data to another Azure Cosmos DB Core (SQL) API container. Use a change feed, not a copy.* You create an Azure function to copy data to another Azure Cosmos DB for NoSQL container.Use a change feed, not a copy.* You create an Azure Synapse pipeline that uses Azure Cosmos DB Core (SQL) API as the input and Azure Blob Storage as the output.Use a function, not a pipeline.* You create an Azure Synapse pipeline that uses Azure Cosmos DB for NoSQL as the input and Azure Blob Storage as the output.Use a function, not a pipeline.* You create an Azure Synapse pipeline that uses Azure Cosmos DB for NoSQL change feed as a trigger and an Azure event hub as the output.Use a function, not a pipeline.Note: The Azure Cosmos DB change feed is a mechanism to get a continuous and incremental feed of records from an Azure Cosmos container as those records are being created or modified. Change feed support works by listening to container for any changes. It then outputs the sorted list of documents that were changed in the order in which they were modified.Solution components:The following diagram represents the data flow and components involved in the solution:1. Data Generation: Data simulator is used to generate retail data that represents events such as a user viewing an item, adding an item to their cart, and purchasing an item. You can generate large set of sample data by using the data generator.2. Azure Cosmos DB: The generated data is stored in an Azure Cosmos DB container.3. Change Feed: The change feed will listen for changes to the Azure Cosmos DB container. Each time a new document is added into the collection (that is when an event occurs such a user viewing an item, adding an item to their cart, or purchasing an item), the change feed will trigger an Azure Function.4. Azure Function: The Azure Function processes the new data and sends it to Azure Event Hubs.5. Azure event hub: The event hub stores these events and sends them to Azure Stream Analytics to perform further analysis.6. Azure Stream Analytics: Azure Stream Analytics defines queries to process the events and perform real-time data analysis. This data is then sent to Microsoft Power BI.7. Power BI: Power BI is used to visualize the data sent by Azure Stream Analytics. You can build a dashboard to see how the metrics change in real time.
https://docs.microsoft.com/en-us/azure/cosmos-db/sql/changefeed-ecommerce-solution
HOTSPOT (Drag and Drop is not supported)You have an Azure Cosmos DB for NoSQL account that hosts a container named Customers.You need to add customers to Customers by using the Azure Cosmos DB Spark Connector.How should you complete the code? To answer, select the appropriate options in the answer area.Note: Each correct selection is worth one point.Hot Area:
Box 1: ("cosmos.oltp")\Connect to Azure Cosmos DB for NoSQL using SparkWithin the notebook, set OLTP configuration settings for NoSQL account endpoint, database name, and container name.# Set configuration settings config = {"spark.cosmos.accountEndpoint": "<nosql-account-endpoint>","spark.cosmos.accountKey": "<nosql-account-key>","spark.cosmos.database": "cosmicworks","spark.cosmos.container": "products"}Use the Catalog API to manage account resources such as databases and containers. Then, you can use OLTP to manage data within the container resource[s].Example, Ingest dataUse spark.createDataFrame and the previously saved OLTP configuration to add sample data to the target container.# Ingest sample data spark.createDataFrame(products) \.toDF("id", "category", "name", "quantity", "price", "clearance") \.write \.format("cosmos.oltp") \.options(**config) \.mode("APPEND") \.save()Box 2: ("APPEND")\
https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/tutorial-spark-connecto
Post your Comments and Discuss Microsoft DP-420 exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the DP-420 content, but please register or login to continue.