MSDN

High Availability for Azure Database for MariaDB

Azure Database for MariaDB offers built-in high availability (HA) to ensure your workloads remain online and resilient against planned or unplanned outages. This guide covers the architecture, configuration steps, monitoring, and best practices.

Architecture Overview

Primary Server Standby Server Asynchronous Replication Load Balancer (optional)

The HA architecture uses asynchronous replication between the primary and a standby server located in a different Azure Availability Zone. In the event of a zone failure, failover is automatic, promoting the standby to primary.

To enable HA when creating a new MariaDB server, set highAvailability to Enabled and select the desired zoneRedundant option.

az mariadb server create \
  --resource-group MyResourceGroup \
  --name mymariadbserver \
  --location eastus2 \
  --admin-user myadmin \
  --admin-password MyP@ssw0rd! \
  --sku-name B_Gen5_2 \
  --high-availability Enabled \
  --zone-redundant true

For existing servers, HA can be added via the Azure portal or CLI:

az mariadb server update \
  --resource-group MyResourceGroup \
  --name mymariadbserver \
  --high-availability Enabled \
  --zone-redundant true

Azure Monitor provides metrics and alerts for HA status:

  • Replication Lag – ensures the standby is up to date.
  • Failover Events – logs automatic or manual failovers.
  • Availability Zone Health – monitors zone status.

Set up alerts:

az monitor metrics alert create \
  --resource-group MyResourceGroup \
  --name MariaDBReplicationLagAlert \
  --scopes /subscriptions/xxxx/resourceGroups/MyResourceGroup/providers/Microsoft.DBforMariaDB/servers/mymariadbserver \
  --condition "max AggregationType=Average MetricName='ReplicationLag' Threshold=30" \
  --description "Alert when replication lag exceeds 30 seconds"
  1. Enable zone redundancy for critical workloads.
  2. Use read replica endpoints for reporting to offload reads.
  3. Configure backup retention of at least 7 days.
  4. Test manual failover during maintenance windows.
  5. Monitor replication lag and set alerts accordingly.

Related Topics