Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

Implement a data modeling and partitioning strategy for Azure Cosmos DB SQL API Microsoft Quiz Answers

Get Implement a data modeling and partitioning strategy for Azure Cosmos DB SQL API Microsoft Quiz Answers

In this learning path, you’ll learn how Azure Cosmos DB uses partitioning to scale containers and how spending some time thinking about your data model helps to meet the performance needs of your applications.

This learning path helps prepare you for Exam DP-420: Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB.

Prerequisites:

Before starting this learning path, you should already have:

  • Familiarity with Azure and the Azure portal.
  • Experience programming with C#. If you have no previous programming experience, we recommend you complete the Take your first steps with C# learning path before starting this one.

Enroll on Microsoft

Module 1: Implement a non-relational data model

Identify an application’s key access patterns. Define the entities’ data model, along with containers to store the data with a partition key that will result in an efficient and scalable data store for the application.

Learning objectives:

In this module, you will:

  • Determine access patterns for data.
  • Apply data model and partitioning strategies to support an efficient and scalable NoSQL database.

Prerequisites:

  • Familiarity with Azure Cosmos DB concepts, like databases, containers, documents, and throughput in Request Units per second (RU/s)
  • Familiarity with using Azure Cosmos DB resources and data in the Azure portal, like using Data Explorer, running queries, and viewing query stats

Quiz 1: Knowledge check

Q1. Which of the following criteria would define a good candidate to embed two entities in a single document schema?

  • Many: Many relationships
  • Read or updated together
  • Read or updated independently

Q2. Consider the following scenario: Your company has customers across four countries, with hundreds of thousands of customers for countries 1 and 2, and a few thousand customers for countries 3 and 4. Requests for each country total approximately 50,000 RU/s every hour of the day. Your application team proposes to use countryId as the partition key for this container. Which of the following statements is true?

  • This partition key will prevent throughput hot partitions.
  • This partition key will cause fan outs when filtering by countryId.
  • This partition key could cause storage hot partitions

Q3. Why is understanding the access pattern of your application and how to use this information in your data model design important?

  • Understanding the access pattern of your application helps you identify where to save space when storing our data.
  • Understanding the access pattern of your application helps you identify how to access your data with fewer requests.
  • Understanding the access pattern of your applications wouldn’t help you identify the correct schema of your data.

Module 2: Design a data partitioning strategy

Identify strategies for managing relationships between data entities, such as customers and sales data. Improve data-model performance and scaling by pre-aggregating and denormalizing your data. Use change-feed to maintain your data’s referential integrity.

Learning objectives:

At the completing this module we will learn:

  • Manage relationships between data entities by using advanced modeling and partitioning strategies.
  • Maintain the referential integrity of your data by using change feed.
  • Implement pre-aggregating and denormalizing data strategies to improve data-model performance and scaling.
  • Optimizing storage and compute by mixing entity types in a single container

Prerequisites:

  • Familiarity with Azure Cosmos DB concepts such as databases, containers, documents, and throughput (request units per second [RU/s]).
  • Familiarity with navigating Azure Cosmos DB resources and data by using Data Explorer in the Azure portal, running queries, and viewing query stats in results.
  • Familiarity with basic modeling and partitioning strategies, such as embedding or referencing data in entities.
  • Familiarity with Azure Cosmos DB .NET SDK v3.
  • Familiarity with Azure Cosmos DB change feed.

Quiz 1: Knowledge check

Q1. In Azure Cosmos DB, what would be the most optimum way of managing referential integrity between different containers?

  • When your app creates any changes to one container, also make sure it duplicates the changes on the referenced container.
  • Create an Azure Cosmos DB Function that periodically searches for changes done to your containers and replicate those changes to the referenced containers.
  • Use an Azure Function trigger for Azure Cosmos DB to leverage on the change feed processor to update the referenced containers

Q2. Consider the following Scenario: You are creating an application that will save the device metrics generated every minute by your different IOT devices. You have identified two entities that you would like to collect data for, the devices and the device metrics generated by each device. You were going to create two containers for these different entities but your data engineer suggests that you place both entities, in one single container. What should you do?

  • Create a document with the deviceid property and the rest of the device data and embed each metrics collection into the document with the devicemetricsid property and all the metrics data
  • Create a document with the deviceid property and the rest of the device data, add a property called type and give it the value device. Create a document for each metrics data collected with the devicemetricsid property and all the metrics data, add a property called type and give it the value devicemetrics
  • Create a document with the deviceid property and the rest of the device data, add a property called type and give it the value device‘. Create a document for each metrics data collected with the devicemetricsid and deviceid properties and all the metrics data, add a property called type and give it the value devicemetrics

Q3. Consider the following Scenario: You are creating an application that will save the device metrics generated every minute by your different IOT devices. You have identified two entities that you would like to collect data for, the devices and the device metrics data generated by each device. You were going to create two containers for these different entities but your data engineer suggests that you place both entities, in one single container. You would like to be able to return the device’s general data and the number of metrics collections per device. How could we keep track of this inside the container?

  • Use a GROUP BY parameter in your query and use the aggregate count to return the number of device metrics collections per device.
  • Add a new property to your device documents called metricscollectioncount and update it with the current number of metrics collection documents, when your app or Azure function adds a new metrics collection, also add 1 to the metricscollectioncount property.
  • Add a new property to your device documents called metricscollectioncount and update it with the current number of metrics collection documents, when your app or Azure function adds a new metrics collection, also add 1 to the metricscollectioncount property inside a transactional batch.
Conclusion:

I hope this Implement a data modeling and partitioning strategy for Azure Cosmos DB SQL API Microsoft Quiz Answers would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.

This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.

Keep Learning!

More Coding Solutions >>

LeetCode Solutions

Hacker Rank Solutions

CodeChef Solutions

Leave a Reply

Your email address will not be published. Required fields are marked *