Use availability zones in Azure Cosmos DB for PostgreSQL

APPLIES TO: Azure Cosmos DB for PostgreSQL (powered by the Citus database extension to PostgreSQL)

Azure Cosmos DB for PostgreSQL provisions all nodes of a cluster in a single availability zone (AZ) for better performance and availability. If cluster has high availability enabled, all standby nodes are provisioned into another availability zone to make sure all nodes in cluster continue to be available, with a possible failover, if there is an AZ outage.

To get resiliency benefits of availability zones, your cluster needs to be in one of the Azure regions where Azure Cosmos DB for PostgreSQL is configured for AZ outage resiliency.

In this article, you learn how to specify preferred availability zone for your Azure Cosmos DB for PostgreSQL cluster. You will also learn how to check availability zone for each node once cluster is provisioned.

Specify preferred availability zone for new cluster

By default preferred availability zone isn't set for a new cluster. In that case Azure Cosmos DB for PostgreSQL service would randomly select an availability zone for primary nodes.

Selecting preferred AZ is possible during cluster creation on the Scale page in the Availability zones section.

Change preferred availability zone

Once cluster is provisioned, select AZ in the Preferred availability zone drop-down list on the Scale page for your cluster in the Azure portal. Click the Save button to apply your selection.

To avoid disruption, change of the availability zone isn't applied immediately. Rather all nodes are going to be moved to preferred availability zone during the next maintenance event.

Check availability zone for each node

The Overview tab for the cluster lists all nodes along with the Availability zone column that shows actual availability zone for each primary cluster node.

Next steps