Book Image

A Developer's Guide to .NET in Azure

By : Anuraj Parameswaran, Tamir Al Balkhi
Book Image

A Developer's Guide to .NET in Azure

By: Anuraj Parameswaran, Tamir Al Balkhi

Overview of this book

A Developer’s Guide to .NET in Azure helps you embark on a transformative journey through Microsoft Azure that is tailored to .NET developers. This book is a curated compendium that’ll enable you to master the creation of resilient, scalable, and highly available applications. The book is divided into four parts, with Part 1 demystifying Azure for you and emphasizing the portal's utility and seamless integration. The chapters in this section help you configure your workspace for optimal Azure synergy. You’ll then move on to Part 2, where you’ll explore serverless computing, microservices, containerization, Dapr, and Azure Kubernetes Service for scalability, and build pragmatic, cost-effective applications using Azure Functions and Container apps. Part 3 delves into data and storage, showing you how to utilize Azure Blob Storage for unstructured data, Azure SQL Database for structured data, and Azure Cosmos DB for document-oriented data. The final part teaches you about messaging and security, utilizing Azure App Configuration, Event Hubs, Service Bus, Key Vault, and Azure AD B2C for robust, secure applications. By the end of this book, you’ll have mastered Azure's responsive infrastructure for exceptional applications.
Table of Contents (20 chapters)
1
Part 1: An Introduction to Your Environment
3
Part 2: Serverless and Microservices
8
Part 3: Data and Storage
12
Part 4: Messaging Mechanisms and Security

Understanding partition keys in Azure Cosmos DB

A partition key is a property of a document in Cosmos DB that is used to determine the physical partition in which the document is stored. When you create a container in Cosmos DB, you specify a partition key for that container. Cosmos DB then uses the partition key to distribute documents across multiple logical partitions based on the value of the partition key.

Figure 8.3 – Partition key in Cosmos DB

For example, let’s say you have a container called orders in Cosmos DB, and you want to partition your data by customer ID. You can specify the customer ID as the partition key when you create the container. Cosmos DB will then use the customer ID to distribute orders across multiple physical partitions based on the value of the customer ID.

Currently, in Azure Cosmos DB, logical partitions have a maximum size limit of 20 GB. This limit is a “hard” limit, meaning that once reached...