Skip to content

Commit eacca7d

Browse files
authored
Merge pull request #272028 from anaharris-ms/rel-cosmos
Reliability doc: Cosmos DB for NoSQL
2 parents affc350 + 17d3d30 commit eacca7d

9 files changed

+462
-142
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4024,6 +4024,11 @@
40244024
"source_path_from_root":"/articles/aks/generation-2-vm-windows.md",
40254025
"redirect_url":"/azure/aks/generation-2-vm",
40264026
"redirect_document_id":false
4027+
},
4028+
{
4029+
"source_path_from_root":"/articles/cosmos-db/high-availability.md",
4030+
"redirect_url":"/azure/reliability/reliability-cosmos-db-nosql.md",
4031+
"redirect_document_id":false
40274032
}
40284033
]
40294034
}

articles/cosmos-db/nosql/TOC.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,10 @@
347347
href: ../consistency-levels.md
348348
- name: High availability
349349
items:
350-
- name: High availability overview
351-
href: ../high-availability.md
350+
- name: High availability and reliability
351+
href: ../../reliability/reliability-cosmos-db-nosql.md?toc=/azure/cosmos-db/toc.json
352+
- name: Proactive resiliency
353+
href: ../../reliability/resiliency-recommendations/recommend-cosmos-db-nosql.md?toc=/azure/cosmos-db/toc.json
352354
- name: Multi-region writes
353355
items:
354356
- name: Understanding multi-region writes

articles/reliability/TOC.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
href: migrate-container-instances.md
4141
- name: Azure Container Registry
4242
href: /azure/container-registry/zone-redundancy?toc=/azure/reliability
43-
- name: Azure Cosmos DB
44-
href: /azure/cosmos-db/high-availability?toc=/azure/reliability
43+
- name: Azure Cosmos DB for NoSQL
44+
href: migrate-cosmos-nosql.md
4545
- name: Azure Database for MySQL - Flexible Server
4646
href: migrate-database-mysql-flex.md
4747
- name: Azure Database for PostgreSQL
@@ -92,12 +92,12 @@
9292
href: overview-reliability-guidance.md
9393
- name: Foundational services
9494
items:
95-
- name: Azure Cosmos DB
95+
- name: Azure Cosmos DB for NoSQL
9696
items:
97-
- name: Availability zones
98-
href: ../cosmos-db/high-availability.md?toc=/azure/reliability/toc.json&bc=/azure/reliability/breadcrumb/toc.json
99-
- name: Disaster recovery
100-
href: ../cosmos-db/how-to-multi-master.md?toc=/azure/reliability/toc.json&bc=/azure/reliability/breadcrumb/toc.json
97+
- name: Proactive resiliency
98+
href: resiliency-recommendations/recommend-cosmos-db-nosql.md
99+
- name: Reliability guide
100+
href: reliability-cosmos-db-nosql.md
101101
- name: Azure Event Hubs
102102
href: ../event-hubs/event-hubs-geo-dr.md?toc=/azure/reliability/toc.json&bc=/azure/reliability/breadcrumb/toc.json
103103
- name: Azure ExpressRoute

articles/reliability/availability-service-by-category.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Azure services are presented in the following tables by category. Note that some
3232
> |----------------------------------------|---------------------------------------------------|
3333
> | Azure Application Gateway | Azure API Management |
3434
> | Azure Backup | Azure App Configuration |
35-
> | Azure Cosmos DB | Azure App Service |
35+
> | Azure Cosmos DB for NoSQL | Azure App Service |
3636
> | Azure Event Hubs | Microsoft Entra Domain Services |
3737
> | Azure ExpressRoute | Azure Bastion |
3838
> | Azure Key Vault | Azure Batch |

articles/reliability/availability-zones-service-support.md

Lines changed: 42 additions & 42 deletions
Large diffs are not rendered by default.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: Migrate Azure Cosmos DB for NoSQL to availability zone support
3+
description: Learn how to migrate your Azure Cosmos DB for NoSQL to availability zone support.
4+
author: anaharris-ms
5+
ms.service: sql
6+
ms.topic: conceptual
7+
ms.date: 04/15/2024
8+
ms.author: anaharris
9+
ms.custom: references_regions, subject-reliability
10+
---
11+
12+
# Migrate Azure Cosmos DB for NoSQL to availability zone support
13+
14+
This guide describes how to migrate Azure Cosmos DB for NoSQL from non-availability zone support to availability support.
15+
16+
Using availability zones in Azure Cosmos DB has no discernible impact on performance or latency. It doesn't require any adjustments to the selected consistency mode, and also doesn't require any modification to application code.
17+
18+
When availability zones are enabled, Azure Cosmos DB intelligently distributes the four replicas of your data across all available zones. This ensures that, in the event of an outage in one availability zone, the account remains fully operational. In contrast, without availability zones, all replicas would be located in a single availability zone (we do not expose which), leading to potential downtime if that specific zone experiences an issue.
19+
20+
Enabling availability zones is a great way to increase resilience of your Cosmos DB database without introducing additional application complexities, affecting performance, or even incurring additional costs, if autoscale is also used.
21+
22+
23+
## Prerequisites
24+
25+
- Serverless accounts can use availability zones, but this choice is only available during account creation. Existing accounts without availability zones cannot be converted to an availability zone configuration. For mission critical workloads, provisioned throughput is the recommended choice.
26+
27+
- Understand that enabling availability zones is not an account-wide choice. A single Cosmos DB account can span an arbitrary number of Azure regions, each of which can independently be configured to leverage availability zones and some regional pairs may not have availability zone support. This is important, as some regions do not yet support availability zones, but adding them to a Cosmos DB account will not prevent enabling availability zones in other regions configured for that account. The billing model also reflects this possibility. For more information on SLA for Cosmos DB, see [Reliability in Cosmos DB for NoSQL](./reliability-cosmos-db-nosql.md#sla-improvements). To see which regions support availability zones, see [Azure regions with availability zone support](./availability-zones-service-support.md#azure-regions-with-availability-zone-support)
28+
29+
## Downtime requirements
30+
31+
When you migrate to availability zone support, a small amount of write unavailability (a few seconds) occurs when adding and removing the secondary region, as the system deliberately stops writes in order to check consistency between regions.
32+
33+
## Migration
34+
35+
Because you can't enable availability zones in a region that has already been added to your account, you'll need to remove that region and add it again with availability zones enabled. To avoid any service disruption, you'll add and failover to a temporary region until the availability zone configuration is complete.
36+
37+
Follow the steps below to enable availability zones for your account in select regions.
38+
39+
40+
# [Azure portal](#tab/portal)
41+
42+
1. Add a temporary region to your database account by following steps in [Add region to your database account](/azure/cosmos-db/how-to-manage-database-account#addremove-regions-from-your-database-account).
43+
44+
1. If your Azure Cosmos DB account is configured with multi-region writes, skip to the next step. Otherwise, perform manual failover to the temporary region by following the steps in [Perform manual failover on an Azure Cosmos DB account](/azure/cosmos-db/how-to-manage-database-account?source=recommendations#manual-failover).
45+
46+
1. Remove the region for which you would like to enable availability zones by following steps in [Remove region to your database account](/azure/cosmos-db/how-to-manage-database-account#addremove-regions-from-your-database-account).
47+
48+
1. Add back the region to be enabled with availability zones:
49+
1. [Add region to your database account](/azure/cosmos-db/how-to-manage-database-account#addremove-regions-from-your-database-account).
50+
1. Find the newly added region in the **Write region** column, and enable **Availability Zone** for that region.
51+
1. Select **Save**.
52+
53+
1. Perform failback to the availability zone-enabled region by following the steps in [Perform manual failover on an Azure Cosmos DB account](/azure/cosmos-db/how-to-manage-database-account?source=recommendations#manual-failover).
54+
55+
1. Remove the temporary region by following steps in [Remove region to your database account](/azure/cosmos-db/how-to-manage-database-account#addremove-regions-from-your-database-account).
56+
57+
# [Azure CLI](#tab/cli)
58+
59+
1. Add a temporary region to your database account. The following example shows how to add West US as a secondary region to an account configured with East US region only. You must include all existing regions and any new ones in the command.
60+
61+
```azurecli
62+
63+
az cosmosdb update --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup --locations regionName=eastus failoverPriority=0 isZoneRedundant=False --locations regionName=westus failoverPriority=1 isZoneRedundant=False
64+
65+
```
66+
67+
1. If your Azure Cosmos DB account is configured with multi-region writes, skip to the next step. Otherwise, perform manual failover to the newly added temporary region. The following example shows how to perform a failover from East US region (current write region) to West US region (current read-only region). You must include both regions in the command.
68+
69+
```azurecli
70+
71+
az cosmosdb failover-priority-change --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup --failover-policies westus=0 eastus=1
72+
73+
```
74+
75+
1. Remove the region for which you would like to enable availability zones. The following example shows how to remove East US region from an account configured with West US (write region) and East US (read-only) regions. You must include all regions that shouldn't be removed in the command.
76+
77+
```azurecli
78+
79+
az cosmosdb update --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup --locations regionName=westus failoverPriority=0 isZoneRedundant=False
80+
81+
```
82+
83+
1. Add back the region to be enabled with availability zones. The following example shows how to add East US as an AZ-enabled secondary region to an account configured with West US region only. You must include any existing regions and all new ones in the command.
84+
85+
86+
```azurecli
87+
az cosmosdb update --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup --locations regionName=westus failoverPriority=0 isZoneRedundant=False --locations regionName=eastus failoverPriority=1 isZoneRedundant=True
88+
```
89+
90+
1. Perform failback to the availability zone-enabled region. The following example shows how to perform a failover from West US region (current write region) to East US region (current read-only region). You must include both regions in the command.
91+
92+
```azurecli
93+
94+
az cosmosdb failover-priority-change --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup --failover-policies eastus=0 westus=1
95+
```
96+
97+
1. Remove temporary region. The following example shows how to remove West US region from an account configured with East US (write region) and West US (read-only) regions. You must include all accounts that should not be removed in the command.
98+
99+
100+
```azurecli
101+
102+
az cosmosdb update --name MyCosmosDBDatabaseAccount --resource-group MyResourceGroup --locations regionName=eastus failoverPriority=0 isZoneRedundant=True
103+
104+
```
105+
106+
107+
## Related content
108+
109+
- [Move an Azure Cosmos DB account to another region](/azure/cosmos-db/how-to-move-regions)
110+
- [Azure services and regions that support availability zones](availability-zones-service-support.md)

articles/reliability/overview-reliability-guidance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ For a more detailed overview of reliability principles in Azure, see [Reliabilit
2424

2525
| Product| Availability zone guide | Disaster recovery guide |
2626
|----------|----------|----------|
27-
|Azure Cosmos DB|[Achieve high availability](../cosmos-db/high-availability.md?toc=/azure/reliability/toc.json&bc=/azure/reliability/breadcrumb/toc.json)| [Configure multi-region writes](../cosmos-db/nosql/how-to-multi-master.md?tabs=api-async&?toc=/azure/reliability/toc.json&bc=/azure/reliability/breadcrumb/toc.json) |
27+
|Azure Cosmos DB for NoSQL|[Reliability in Cosmos DB for NoSQL](reliability-cosmos-db-nosql.md)| [Reliability in Cosmos DB for NoSQL](reliability-cosmos-db-nosql.md) |
2828
|Azure Event Hubs| [Availability Zones](../event-hubs/event-hubs-geo-dr.md?toc=/azure/reliability/toc.json&bc=/azure/reliability/breadcrumb/toc.json#availability-zones)| [Geo-disaster recovery](../event-hubs/event-hubs-geo-dr.md?toc=/azure/reliability/toc.json&bc=/azure/reliability/breadcrumb/toc.json) |
2929
|Azure ExpressRoute| [Designing for high availability with ExpressRoute](../expressroute/designing-for-high-availability-with-expressroute.md?toc=/azure/reliability/toc.json&bc=/azure/reliability/breadcrumb/toc.json)|[Designing for disaster recovery with ExpressRoute private peering](../expressroute/designing-for-disaster-recovery-with-expressroute-privatepeering.md?toc=/azure/reliability/toc.json&bc=/azure/reliability/breadcrumb/toc.json)|
3030
|Azure Key Vault|[Azure Key Vault failover within a region](../key-vault/general/disaster-recovery-guidance.md?toc=/azure/reliability/toc.json&bc=/azure/reliability/breadcrumb/toc.json#failover-within-a-region)| [Azure Key Vault](../key-vault/general/disaster-recovery-guidance.md?toc=/azure/reliability/toc.json&bc=/azure/reliability/breadcrumb/toc.json#failover-across-regions) |

0 commit comments

Comments
 (0)