Contoso runs an Azure Cosmos DB for NoSQL account named contoso-orders. The account uses autoscale provisioned throughput and has one region, East US 2, which is the write region. East US 2 was added without availability zone support.
You must make the following changes:
- East US 2 must become zone-redundant.
- When the work is finished, East US 2 must be the account's only region and its write region.
- The account must keep strong consistency throughout.
- All regions are healthy. Use only operations that don't risk losing writes that haven't replicated.
You can use Central US as a temporary region.
Which actions should you perform, in order?
You didn't answer this one.
Zone redundancy is set per region when the region is added. Updating an existing region requires temporarily hosting writes elsewhere while the original region is removed and recreated with zone redundancy enabled. In single-region write mode, the write region can't be deleted, so the change write region operation has to move writes to Central US before East US 2 is removed, and back again before Central US is removed. A re-added region becomes available only after its data is fully replicated. Multi-region writes would avoid the write-region restriction, but it can't be combined with the strong consistency the scenario requires.
- Step 1: Add Central US to the account as a second region. East US 2 is the only region, and a change write region operation needs an account with multiple regions. The temporary region must therefore exist before anything else can happen.
- Step 2: Run the change write region operation to make Central US the write region. This operation needs Central US from step 1. In single-region write mode, the write region can't be removed, so writes must move off East US 2 first. All regions are healthy, so the planned change write region operation is the one to use, and it loses no data.
- Step 3: Remove East US 2 from the account. After step 2, East US 2 is a read region and can be removed. Zone redundancy can't be switched on for a region that already exists, so the region must leave the account before it can be added back with zone redundancy.
- Step 4: Add East US 2 to the account again with the Availability zone checkbox selected. East US 2 can be added back only after step 3 removes it. Zone redundancy is chosen when a region is added, so the checkbox must be selected in this step.
- Step 5: After East US 2 is available, run the change write region operation to make East US 2 the write region. East US 2 must exist again (step 4), and its data must be fully replicated before it is marked available. Only then can it become the write region, which the requirements demand.
- Step 6: Remove Central US from the account. Central US is the write region until step 5, and in single-region write mode the write region can't be removed. Removing it last leaves East US 2 as the only region, as required.
- Not needed: On the Manage regions pane, select the Availability zone checkbox for the existing East US 2 region. Zone redundancy is configured when a region is added. A region that already exists has to be removed and re-added through a temporary region; it can't be switched on in place.
- Not needed: Enable multi-region writes on the account. In multi-region write mode, any region can be removed. However, strong consistency isn't available with multi-region writes, so this breaks the requirement to keep strong consistency.