Skip to content
Certification Guides

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.

Preview 16 of 204 pages

See the first 16 pages exactly as they appear in the document.

  1. Page 1
    Read page 1 as text

    › Hands-on preparation and practice › Practical skills advancement for practitioners › Prescriptive guidance from expert voices Designing and Implementing Cloud- native Applications Using Microsoft Azure Cosmos DB Study Companion for the DP-420 Exam › Steve Flowers CERTIFICATION STUDY COMPANION SERIES

  2. Page 2
  3. Page 3
    Read page 3 as text

    Certification Study Companion Series

  4. Page 4
    Read page 4 as text

    More information about this series at https://link.springer.com/bookseries/17100 The Apress Certification Study Companion Series offers guidance and hands-on practice to support technical and business professionals who are studying for an exam in the pursuit of an industry certification. Professionals worldwide seek to achieve certifications in order to advance in a career role, reinforce knowledge in a specific discipline, or to apply for or change jobs. This series focuses on the most widely taken certification exams in a given field. It is designed to be user friendly, tracking to topics as they appear in a given exam. Authors for this series are experts and instructors who not only possess a deep understanding of the content, but also have experience teaching the key concepts that support readers in the practical application of the skills learned in their day-to-day roles.

  5. Page 5
    Read page 5 as text

    Designing and Implementing Cloud- native Applications Using Microsoft Azure Cosmos DB Study Companion for the DP-420 Exam Steve Flowers

  6. Page 6
    Read page 6 as text

    ISBN-13 (pbk): 978-1-4842-9546-5 ISBN-13 (electronic): 978-1-4842-9547-2 https://doi.org/10.1007/978-1-4842-9547-2 Copyright © 2023 by Steve Flowers This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material 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 information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary 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 or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein. Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editor: Jonathan Gennick Development Editor: Laura Berendson Editorial Project Manager: Shaul Elson Cover by eStudioCalamar Distributed 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 a Delaware corporation. 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 and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales. Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub (https://github.com/Apress). For more detailed information, please visit https://www.apress.com/gp/services/source-code. Paper in this product is recyclable Steve Flowers Perrysburg, OH, USA Designing and Implementing Cloud-native Applications Using Microsoft Azure Cosmos DB: Study Companion for the DP-420 Exam

  7. Page 7
    Read page 7 as text

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

  8. Page 8
    Read page 8 as text

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

  9. Page 9
    Read page 9 as text

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

  10. Page 10
    Read page 10 as text

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

  11. Page 11
    Read page 11 as text

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

  12. Page 12
    Read page 12 as text

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

  13. Page 13
    Read page 13 as text

    xiii About the Author Steve Flowers is a Senior Cloud Solution Architect at Microsoft focused on Data and AI. He has 12 years of experience in technology, and for the past three years, he has helped customers achieve success with Azure Cosmos DB. In 2022, Steve achieved the Azure Cosmos DB Technical Insider badge acknowledging his training with the product group and Microsoft Global Black Belts in Azure Cosmos DB, and for helping enterprise customers architect and deploy Azure Cosmos DB. Steve’s technical experience ranges from networking and system administration to cloud-native development on Azure and IoT solutions. He is passionate about data architecture and enjoys the challenge of a customer-driven role within Microsoft.

  14. Page 14
    Read page 14 as text

    xv About the Technical Reviewer Hasan Savran is a highly experienced Senior Business Intelligence Manager at Progressive Insurance Company and a distinguished Microsoft Data Platform MVP based in the United States. He is also the head of SavranWeb Cosmos DB Consulting, where he showcases his exceptional industry knowledge and skills. Sharing knowledge and expertise with the community is his passion. He achieves this by speaking at tech conferences globally and writing on his blog: https://bit.ly/44wr52u . Hasan has also developed a 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 a seamless and efficient experience for interacting with the platform, making it a valuable asset for any user.

  15. Page 15
    Read page 15 as text

    xvii Acknowledgments Thank 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 the opportunity. Thank you to Sergiy Smyrnov, Howard Ginsburg, Jeremiah Gutherie, Marc Grove, Prasad Nair, and my other Microsoft colleagues who have helped me on my Azure Cosmos DB journey. Thank you to the Azure Cosmos DB Product Group for building the best cloud distributed NoSQL platform in the industry. And thank you for all you do to train and share 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

  16. Page 16
    Read page 16 as text

    xix The goal of this book is to introduce readers to the Azure Cosmos DB service and the topics covered on the DP-420 certification exam. Whether you are a developer experienced with using Azure Cosmos DB or you are just starting your journey, I hope this book can provide valuable information for you. Gaining technical certificates is a way to show your employer or potential employers you are proficient in a specific technology. Many exams have come and gone over the years. The value of those that fade also diminish with technology. But NoSQL will likely remain a relevant skill for years to come, and though this book is focused specifically on Azure Cosmos DB, many of the topics discussed in this book can be applied to other NoSQL products and platforms. Some readers may also be seeking to obtain this certification as a mechanism of self-study. Having a predetermined outline for learning and a goal to accomplish such as the passing of an exam can be an excellent starter. This book will certainly help you thoroughly understand NoSQL concepts and how to work with the Azure Cosmos DB platform, 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 applied to any study material on a subject: don’t stop here. Don’t let this book carry you through the exam. Study the documentation. Dig into topics you don’t understand using the vast resources at your fingertips: ChatGPT, StackOverflow, Discord, Slack, LinkedIn, YouTube, etc. Work through the quick starts and tutorials in the Microsoft documentation, many of which are linked in the companion repository associated with this text. 1 And if you aren’t using Azure Cosmos DB in your current role, stay connected to the aforementioned communities and keep your skills sharp. NoSQL proficiency is likely to be relevant in your career aspirations. Good luck, and thanks for reading. Preface 1 https://github.com/Apress/designing-and-implementing-cloud-native-applications

188 more pages in the full document

Unlock it once and it stays in your library, ready to chat with or turn into flashcards.

Unlock the full document
See all

Study this document with CramX

Once it is in your library, every tool can work from it.