You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Azure provides fully managed database services for the two most popular open-source relational database engines: PostgreSQL and MySQL. These services handle infrastructure management, patching, backups, and high availability while remaining compatible with the community editions of each engine.
| Option | Status | Description |
|---|---|---|
| Flexible Server | Recommended | Full control over configuration, zone-redundant HA, and stop/start capability |
| Single Server | Retirement announced | Simpler model with fewer options; migrate to Flexible Server |
| Cosmos DB for PostgreSQL | Available | Distributed PostgreSQL (Citus) for multi-node, horizontally scaled workloads |
Flexible Server is the recommended deployment for all new PostgreSQL workloads on Azure.
Availability Zone 1 Availability Zone 2
┌──────────────────┐ ┌──────────────────┐
│ Primary Server │ ────────> │ Standby Server │
│ (Compute + Data)│ synchronous│ (Compute + Data)│
└──────────────────┘ replication└──────────────────┘
| Feature | Detail |
|---|---|
| PostgreSQL versions | 13, 14, 15, 16 |
| Compute tiers | Burstable (B-series), General Purpose (D-series), Memory Optimised (E-series) |
| Max storage | 16 TB |
| Max connections | Depends on compute tier (e.g., 5,000 for 64 vCores) |
| HA SLA | 99.99% with zone-redundant HA |
| Backups | Automatic, up to 35 days retention |
Flexible Server offers two HA modes:
| Mode | Description | Failover Time |
|---|---|---|
| Zone-redundant | Standby in a different availability zone | ~60–120 seconds |
| Same-zone | Standby in the same zone | ~60–120 seconds |
During failover, the standby is promoted to primary. DNS is updated to point to the new primary. Connections must be re-established (use retry logic in your application).
| Option | Description |
|---|---|
| Public access | Accessible over the internet with firewall rules |
| Private access (VNet integration) | Deployed into a delegated subnet in your VNet |
| Private endpoint | Access over a private IP via Azure Private Link |
For production, use VNet integration or private endpoints to keep database traffic off the public internet.
az postgres flexible-server create \
--resource-group rg-demo \
--name my-pg-server \
--location uksouth \
--tier GeneralPurpose \
--sku-name Standard_D4ds_v5 \
--storage-size 128 \
--version 16 \
--high-availability ZoneRedundant \
--admin-user pgadmin \
--admin-password '<strong-password>'
| Option | Status | Description |
|---|---|---|
| Flexible Server | Recommended | Configurable compute, storage, HA, and stop/start |
| Single Server | Retirement announced | Simpler model; migrate to Flexible Server |
Similar to PostgreSQL Flexible Server:
| Feature | Detail |
|---|---|
| MySQL versions | 5.7, 8.0 |
| Compute tiers | Burstable, General Purpose, Business Critical |
| Max storage | 16 TB |
| HA SLA | 99.99% with zone-redundant HA |
| Backups | Automatic, up to 35 days retention |
MySQL Flexible Server uses MySQL Group Replication for HA:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.