Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023)

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) strengthens your grasp on exam subjects through well-curated practice questions.

Ethan Howard
Contributor
4.7
51
10 months ago
Preview (16 of 204 Pages)
100%
Log in to unlock

Page 1

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 1 preview image

Loading page ...

› Hands-on preparation and practice› Practical skills advancement for practitioners› Prescriptive guidance from expert voicesDesigning andImplementing Cloud-native ApplicationsUsing MicrosoftAzure Cosmos DBStudy Companionfor the DP-420 ExamSteve FlowersCERTIFICATION STUDY COMPANION SERIES

Page 2

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 2 preview image

Loading page ...

Page 3

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 3 preview image

Loading page ...

Certification Study Companion Series

Page 4

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 4 preview image

Loading page ...

More information about this series athttps://link.springer.com/bookseries/17100The Apress Certification Study Companion Series offers guidance and hands-onpractice to support technical and business professionals who are studying for an examin the pursuit of an industry certification. Professionals worldwide seek to achievecertifications in order to advance in a career role, reinforce knowledge in a specificdiscipline, or to apply for or change jobs. This series focuses on the most widely takencertification exams in a given field. It is designed to be user friendly, tracking to topics asthey appear in a given exam. Authors for this series are experts and instructors who notonly possess a deep understanding of the content, but also have experience teaching thekey concepts that support readers in the practical application of the skills learned in theirday-to-day roles.

Page 5

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 5 preview image

Loading page ...

Designing andImplementingCloud-native ApplicationsUsing Microsoft AzureCosmos DBStudy Companion for theDP-420 ExamSteve Flowers

Page 6

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 6 preview image

Loading page ...

ISBN-13 (pbk): 978-1-4842-9546-5ISBN-13 (electronic): 978-1-4842-9547-2https://doi.org/10.1007/978-1-4842-9547-2Copyright © 2023 by Steve FlowersThis work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of thematerial is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,broadcasting, reproduction on microfilms or in any other physical way, and transmission or informationstorage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology nowknown or hereafter developed.Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbolwith every occurrence of a trademarked name, logo, or image we use the names, logos, and images onlyin an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of thetrademark.The use in this publication of trade names, trademarks, service marks, and similar terms, even if they arenot identified as such, is not to be taken as an expression of opinion as to whether or not they are subject toproprietary rights.While the advice and information in this book are believed to be true and accurate at the date of publication,neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors oromissions that may be made. The publisher makes no warranty, express or implied, with respect to thematerial contained herein.Managing Director, Apress Media LLC: Welmoed SpahrAcquisitions Editor: Jonathan GennickDevelopment Editor: Laura BerendsonEditorial Project Manager: Shaul ElsonCover by eStudioCalamarDistributed to the book trade worldwide by Springer Science+Business Media LLC, 1 New York Plaza,Suite 4600, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member(owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is aDelawarecorporation.For information on translations, please e-mail booktranslations@springernature.com; for reprint,paperback, or audio rights, please e-mail bookpermissions@springernature.com.Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions andlicenses are also available for most titles. For more information, reference our Print and eBook Bulk Salesweb page at http://www.apress.com/bulk-sales.Any source code or other supplementary material referenced by the author in this book is available toreaders on GitHub (https://github.com/Apress). For more detailed information, please visithttps://www.apress.com/gp/services/source-code.Paper in this product is recyclableSteve FlowersPerrysburg, OH, USADesigning and Implementing Cloud-native Applications Using Microsoft AzureCosmos DB: Study Companion for the DP-420 Exam

Page 7

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 7 preview image

Loading page ...

Dedicated to my wife Jacqui whose love and support is limitless.

Page 8

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 8 preview image

Loading page ...

viiAbout the Author���������������������������������������������������������������������������������������������������xiiiAbout the Technical Reviewer���������������������������������������������������������������������������������xvAcknowledgments�������������������������������������������������������������������������������������������������xviiPreface�������������������������������������������������������������������������������������������������������������������xixChapter 1:Scheduling and Taking the DP-420 Exam�����������������������������������������������1Benefits of Obtaining the DP-420 Certification�����������������������������������������������������������������������������1Why Should You Take the DP-420 Exam?��������������������������������������������������������������������������������1Who Should Take the DP-420 Exam?��������������������������������������������������������������������������������������2Preparing for the Exam�����������������������������������������������������������������������������������������������������������������3Scheduling the Exam��������������������������������������������������������������������������������������������������������������������4What to Expect When Taking the Exam at a Testing Center�����������������������������������������������������4What to Expect When Taking the Exam Virtually����������������������������������������������������������������������5Test Results�����������������������������������������������������������������������������������������������������������������������������������6You’ve Failed the Exam, Now What?���������������������������������������������������������������������������������������������6Refreshing Your DP-420 Certification��������������������������������������������������������������������������������������������6Summary��������������������������������������������������������������������������������������������������������������������������������������7Chapter 2:Design and Implement a Nonrelational Data Model��������������������������������9Introduction to Data Storage in Azure Cosmos DB������������������������������������������������������������������������9Design and Implement a Nonrelational Data Model for Azure Cosmos DB Core API�������������������11Storing Multiple Entity Types in the Same Container�������������������������������������������������������������11Storing Multiple Related Entities in the Same Document������������������������������������������������������14Document Features and Constraints�������������������������������������������������������������������������������������16Summary������������������������������������������������������������������������������������������������������������������������������������19Table of Contents

Page 9

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 9 preview image

Loading page ...

viiiChapter 3:Plan and Implement Sizing and Scaling�����������������������������������������������21Azure Cosmos DB Under the Hood����������������������������������������������������������������������������������������������21Throughput Provisioning�������������������������������������������������������������������������������������������������������������25Manual Provisioned Throughput��������������������������������������������������������������������������������������������25Autoscale Provisioned Throughput����������������������������������������������������������������������������������������27Serverless Throughput����������������������������������������������������������������������������������������������������������29Shared Throughput Provisioning�������������������������������������������������������������������������������������������������30Plan and Manage Cost����������������������������������������������������������������������������������������������������������������33Summary������������������������������������������������������������������������������������������������������������������������������������35Chapter 4:Design a Data Partitioning Strategy������������������������������������������������������37Choose a Partitioning Strategy���������������������������������������������������������������������������������������������������37Choose a Partition Key����������������������������������������������������������������������������������������������������������������40Evaluate the Cost of Data Partitioning����������������������������������������������������������������������������������������44Summary������������������������������������������������������������������������������������������������������������������������������������46Chapter 5:Implement Client Connectivity Options�������������������������������������������������47Working with the Azure Cosmos DBNET SDK����������������������������������������������������������������������������47Azure Cosmos DB SDK Client Options�����������������������������������������������������������������������������������������52Azure Cosmos DB Emulator��������������������������������������������������������������������������������������������������������53Summary������������������������������������������������������������������������������������������������������������������������������������54Chapter 6:Implement Data Access with Cosmos DB SQL��������������������������������������55SQL Query Basics������������������������������������������������������������������������������������������������������������������������55Advanced SQL Queries����������������������������������������������������������������������������������������������������������������58Working with DateTimes�������������������������������������������������������������������������������������������������������������61Summary������������������������������������������������������������������������������������������������������������������������������������63Chapter 7:Implement Data Access with SQL API SDKs������������������������������������������65Interacting with Documents��������������������������������������������������������������������������������������������������������65Interacting with Many Documents����������������������������������������������������������������������������������������������68Session Control���������������������������������������������������������������������������������������������������������������������������72Summary������������������������������������������������������������������������������������������������������������������������������������74Table of ConTenTs

Page 10

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 10 preview image

Loading page ...

ixChapter 8:Implement Server-Side Programming��������������������������������������������������75Implement Stored Procedures����������������������������������������������������������������������������������������������������75Triggers and User-Defined Functions������������������������������������������������������������������������������������������79Summary������������������������������������������������������������������������������������������������������������������������������������82Chapter 9:Design and Implement a Replication Strategy��������������������������������������83Global Distribution�����������������������������������������������������������������������������������������������������������������������84Data Consistency������������������������������������������������������������������������������������������������������������������������85Global Distribution Configurations in the SDK�����������������������������������������������������������������������������89Summary������������������������������������������������������������������������������������������������������������������������������������91Chapter 10:Design and Implement Multi-region Write������������������������������������������93When to Use Multi-region Write��������������������������������������������������������������������������������������������������93Implement Multi-region Write�����������������������������������������������������������������������������������������������������94Conflict Resolution����������������������������������������������������������������������������������������������������������������������96Summary������������������������������������������������������������������������������������������������������������������������������������99Chapter 11:Enable Analytical Workloads������������������������������������������������������������101Hybrid Transaction and Analytical Platform������������������������������������������������������������������������������101Azure Synapse Link�������������������������������������������������������������������������������������������������������������������103Working with the Analytical Store���������������������������������������������������������������������������������������������104Synapse Link for Serverless SQL����������������������������������������������������������������������������������������105Synapse Link for Synapse Spark�����������������������������������������������������������������������������������������107Summary����������������������������������������������������������������������������������������������������������������������������������108Chapter 12:Design and Implement Change Feeds�����������������������������������������������109Common Change Feed Use Cases��������������������������������������������������������������������������������������������110Processing the Change Feed����������������������������������������������������������������������������������������������������113Using Azure Functions��������������������������������������������������������������������������������������������������������������115Summary����������������������������������������������������������������������������������������������������������������������������������118Table of ConTenTs

Page 11

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 11 preview image

Loading page ...

xChapter 13:Implement Solutions Across Services����������������������������������������������119Event-Driven Architecture���������������������������������������������������������������������������������������������������������120Implement the Event-Driven Architecture���������������������������������������������������������������������������������121Azure Cognitive Search�������������������������������������������������������������������������������������������������������������125Summary����������������������������������������������������������������������������������������������������������������������������������126Chapter 14:Define and Implement an Indexing Strategy�������������������������������������127Indexes in Azure Cosmos DB�����������������������������������������������������������������������������������������������������127Range, Spatial, and Composite Indexes������������������������������������������������������������������������������������129Monitoring Index Usage������������������������������������������������������������������������������������������������������������132Summary����������������������������������������������������������������������������������������������������������������������������������135Chapter 15:Monitor and Troubleshoot an Azure Cosmos DB Solution�����������������137Diagnostic Setting���������������������������������������������������������������������������������������������������������������������138Response Status Codes and Failure Metrics�����������������������������������������������������������������������������139Monitoring Insights�������������������������������������������������������������������������������������������������������������������140Querying Logs and Configuring Alerts���������������������������������������������������������������������������������������143Summary����������������������������������������������������������������������������������������������������������������������������������147Chapter 16:Implement Backup and Restore��������������������������������������������������������149Backup Modes��������������������������������������������������������������������������������������������������������������������������149Configure Backup����������������������������������������������������������������������������������������������������������������������150Restore from Backup����������������������������������������������������������������������������������������������������������������153Summary����������������������������������������������������������������������������������������������������������������������������������157Chapter 17:Implement Security���������������������������������������������������������������������������159Secure Access to Azure Cosmos DB�����������������������������������������������������������������������������������������159Secure Access to Data��������������������������������������������������������������������������������������������������������������161Network Security����������������������������������������������������������������������������������������������������������������������166Data Encryption�������������������������������������������������������������������������������������������������������������������������167Configure Cross-Origin Resource Sharing��������������������������������������������������������������������������������168Summary����������������������������������������������������������������������������������������������������������������������������������169Table of ConTenTs

Page 12

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 12 preview image

Loading page ...

xiChapter 18:Implement Data Movement���������������������������������������������������������������171Programmatic Data Movement�������������������������������������������������������������������������������������������������171Low-Code Pipelines������������������������������������������������������������������������������������������������������������������175Streaming Data�������������������������������������������������������������������������������������������������������������������������179Summary����������������������������������������������������������������������������������������������������������������������������������180Chapter 19:Implementing a DevOps Process������������������������������������������������������181Overview of DevOps in Azure����������������������������������������������������������������������������������������������������181Common Tasks in PowerShell���������������������������������������������������������������������������������������������������182Common Tasks in Azure CLI������������������������������������������������������������������������������������������������������186Deploy Using ARM Template�����������������������������������������������������������������������������������������������������189Summary����������������������������������������������������������������������������������������������������������������������������������193Index���������������������������������������������������������������������������������������������������������������������195Table of ConTenTs

Page 13

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 13 preview image

Loading page ...

xiiiAbout the AuthorSteveFlowersis a Senior Cloud Solution Architect atMicrosoft focused on Data and AI. He has 12 years ofexperience in technology, and for the past three years,he has helped customers achieve success with AzureCosmos DB. In 2022, Steve achieved the Azure Cosmos DBTechnical Insider badge acknowledging his training withthe product group and Microsoft Global Black Belts in AzureCosmos DB, and for helping enterprise customers architectand deploy Azure Cosmos DB. Steve’s technical experienceranges from networking and system administration tocloud-native development on Azure and IoT solutions. He ispassionate about data architecture and enjoys the challengeof a customer-driven role within Microsoft.

Page 14

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 14 preview image

Loading page ...

xvAbout the Technical ReviewerHasanSavranis a highly experienced Senior BusinessIntelligence Manager at Progressive Insurance Companyand a distinguished Microsoft Data Platform MVP based inthe United States. He is also the head of SavranWeb CosmosDB Consulting, where he showcases his exceptional industryknowledge and skills. Sharing knowledge and expertisewith the community is his passion. He achieves this byspeaking at tech conferences globally and writing on hisblog:https://bit.ly/44wr52u. Hasan has also developeda VSCode extension called Azure Cosmos DB SQL Studio (https://bit.ly/3yKWkYP),which streamlines the complexities of working with Azure Cosmos DB. This tool offers aseamless and efficient experience for interacting with the platform, making it a valuableasset for any user.

Page 15

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 15 preview image

Loading page ...

xviiAcknowledgmentsThank you Hasan Savran for your time and deep expertise reviewing this text.Thank you Shaul Elson for your work organizing this effort and Jon Gennick for theopportunity.Thank you to Sergiy Smyrnov, Howard Ginsburg, Jeremiah Gutherie, Marc Grove,Prasad Nair, and my other Microsoft colleagues who have helped me on my AzureCosmos DB journey.Thank you to the Azure Cosmos DB Product Group for building the best clouddistributed NoSQL platform in the industry. And thank you for all you do to train andshare your expertise with the community.Thank you to my many mentors: Charlie, Troy, Erich, Freddy, Kevin, Frannie, Scott,Ken, Edward, Sweta, Amy, Cathy, and Brian.Finally, thank you to all my friends on the Microsoft Azure Discord server!https://aka.ms/azurediscord

Page 16

Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam (2023) - Page 16 preview image

Loading page ...

xixThe goal of this book is to introduce readers to the Azure Cosmos DB service andthe topics covered on the DP-420 certification exam. Whether you are a developerexperienced with using Azure Cosmos DB or you are just starting your journey, I hopethis book can provide valuable information for you.Gaining technical certificates is a way to show your employer or potential employersyou are proficient in a specific technology. Many exams have come and gone over theyears. The value of those that fade also diminish with technology. But NoSQL will likelyremain a relevant skill for years to come, and though this book is focused specificallyon Azure Cosmos DB, many of the topics discussed in this book can be applied to otherNoSQL products and platforms.Some readers may also be seeking to obtain this certification as a mechanism ofself-study. Having a predetermined outline for learning and a goal to accomplish suchas the passing of an exam can be an excellent starter. This book will certainly help youthoroughly understand NoSQL concepts and how to work with the Azure Cosmos DBplatform, whether you choose to take the exam or not.If you do take the exam, I offer an important piece of advice that should be appliedto any study material on a subject: don’t stop here. Don’t let this book carry youthrough the exam. Study the documentation. Dig into topics you don’t understandusing the vast resources at your fingertips: ChatGPT, StackOverflow, Discord, Slack,LinkedIn, YouTube, etc. Work through the quick starts and tutorials in the Microsoftdocumentation, many of which are linked in the companion repository associated withthis text.1And if you aren’t using Azure Cosmos DB in your current role, stay connectedto the aforementioned communities and keep your skills sharp. NoSQL proficiency islikely to be relevant in your career aspirations. Good luck, and thanks for reading.Preface1https://github.com/Apress/designing-and-implementing-cloud-native-applications
Preview Mode

This document has 204 pages. Sign in to access the full document!