Skip to content

Commit bc65829

Browse files
authored
Merge feb5da1 into 466b211
2 parents 466b211 + feb5da1 commit bc65829

File tree

1 file changed

+166
-0
lines changed

1 file changed

+166
-0
lines changed
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# Azure MySQL: <br/> Backup (BU) & Disaster Recovery (DR) - Overview
2+
3+
Costa Rica
4+
5+
[![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com)
6+
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
7+
[brown9804](https://github.com/brown9804)
8+
9+
Last updated: 2025-03-17
10+
11+
----------
12+
13+
<details>
14+
<summary><b>List of References </b> (Click to expand)</summary>
15+
16+
- [Backup and restore in Azure Database for MySQL - Flexible Server](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/concepts-backup-restore)
17+
- [Back up an Azure Database for MySQL flexible server by using Azure Backup (preview)](https://learn.microsoft.com/en-us/azure/backup/backup-azure-mysql-flexible-server)
18+
- [Migrate your MySQL database to Azure Database for MySQL - Flexible Server using dump and restore](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/concepts-migrate-dump-restore)
19+
- [Trigger on-demand backup of an Azure Database for MySQL - Flexible Server instance by using the Azure portal](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/how-to-trigger-on-demand-backup)
20+
21+
</details>
22+
23+
## Content
24+
25+
- [Overview](#overview)
26+
- [Backup BU for MySQL on Azure](#backup-bu-for-mysql-on-azure)
27+
- [Automated Backups](#automated-backups)
28+
- [Change Backups Retention Policy and Redundancy](#change-backups-retention-policy-and-redundancy)
29+
- [Point-in-Time Restore PITR](#point-in-time-restore-pitr)
30+
- [Manual Backups](#manual-backups)
31+
- [On-Demand Backups](#on-demand-backups)
32+
- [Exporting Data](#exporting-data)
33+
- [Backup Storage](#backup-storage)
34+
- [Backup Redundancy Option](#backup-redundancy-option)
35+
- [Disaster Recovery DR for MySQL on Azure](#disaster-recovery-dr-for-mysql-on-azure)
36+
37+
## Overview
38+
39+
> [!NOTE]
40+
> Quick reference on how to create an Azure Database for MySQL Flexible Server:
41+
42+
https://github.com/user-attachments/assets/1c6efd8a-987a-46ac-a81d-6d4ae74b07fd
43+
44+
| **Feature** | **Description**| **Limit**| **Use Cases**|
45+
|---------|---------------|--------| -------|
46+
| **Read Replicas** | Read replicas are copies of the primary MySQL server that are used to offload read operations and improve read scalability. They can be created in the same or different regions and can be promoted to standalone servers in case of a primary server failure. | Up to **10** read replicas can be created per primary server.| - **Scaling Read-Intensive Workloads**: Offload read operations to replicas to improve performance.<br/>- **Disaster Recovery**: Promote replicas to standalone servers in case of primary server failure.<br/>- **Global Distribution**: Improve data access speed by placing replicas closer to users in different regions. |
47+
| **Manual Backups** | Manual backups are on-demand backups that you can create at any time. These backups capture the current state of the database and are stored in geo-redundant storage (GRS) or locally redundant storage (LRS). | Up to **50** on-demand manual backups can be created per server.| - **Data Protection**: Ensure data protection by creating backups before major changes or updates.<br/>- **Quick Recovery**: Use manual backups as restore points to quickly recover from data corruption or accidental deletions.<br/>- **Compliance**: Maintain backups for compliance and auditing purposes. |
48+
49+
## Backup (BU) for MySQL on Azure
50+
51+
> [!IMPORTANT]
52+
> The backup process includes `automated daily snapshot backups and frequent transaction log backups`. The `first snapshot backup is scheduled immediately after the server is created`, and `subsequent snapshots are taken daily. Transaction log backups occur every five minutes, capturing all changes made to the database since the last transaction log backup`. If a scheduled backup fails, the backup service retries every 20 minutes until a successful backup is taken. These backup failures might occur due to heavy transactional production loads on the server instance. In cases of high transaction loads, the backup service may perform multiple backups per day to ensure reliable and quicker restoration using these backups. For MySQL 5.7 servers, long-running or large transactions can prevent global instance-level lock acquisition, which is required for successful daily backups.
53+
54+
| **Category** | **Description** |
55+
|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
56+
| **Automated Backups** | - **Daily Backups**: Azure Database for MySQL automatically performs daily backups of your databases. These backups are stored in geo-redundant storage (GRS) to ensure high availability.<br/>- **Retention Period**: Configure the retention period for automated backups, typically ranging from 7 to 35 days.<br/>- **Point-in-Time Restore (PITR)**: Restore your database to any point within the retention period, providing flexibility in case of accidental data loss or corruption. |
57+
| **Manual Backups** | - **On-Demand Backups**: Create manual backups at any time. These backups are stored in GRS and can be used to restore your database to the state at the time of the backup.<br/>- **Exporting Data**: Export your MySQL database using the `mysqldump` utility, which can be stored in Azure Blob Storage or downloaded locally for additional safety. |
58+
| **Backup Storage** | - **Geo-Redundant Storage (GRS)**: By default, backups are stored in GRS, which replicates data to a secondary region to ensure durability and availability.<br/>- **Locally Redundant Storage (LRS)**: For cost savings, you can opt for LRS, which keeps multiple copies of your data within a single region. |
59+
60+
### Automated Backups
61+
62+
> `Automated Backups` for Azure Database for MySQL ensure that your data is regularly backed up without manual intervention.
63+
64+
#### Change Backups Retention Policy and Redundancy
65+
66+
> Azure Database for MySQL automatically performs daily snapshot backups of the data files and transaction logs. These backups are stored in geo-redundant storage (GRS) to ensure high availability and durability.
67+
68+
1. **Access the Azure Portal**: Navigate to the Azure Portal and sign in with your credentials.
69+
2. **Navigate to Your MySQL Flexible Server**: In the Azure Portal, go to `All resources` and select your Azure Database for MySQL Flexible Server instance.
70+
3. **Compute + Storage Settings**: In the left-hand menu, under `Settings`, select `Compute + storage`.
71+
4. **Backup Retention**:
72+
- In the `Backups` section, you will find the slider labeled `Backup retention period in days`.
73+
- Use the slider to set the retention period for automated backups, which can range from 7 to 35 days.
74+
75+
https://github.com/user-attachments/assets/769fa81a-450f-4cd9-a4d9-8f4f227c01c9
76+
77+
5. **Backup Redundancy**:
78+
- Below the retention slider, you will see options for backup redundancy, select the desired redundancy option based on your requirements:
79+
- **Locally-redundant**: Keeps multiple copies of your data within a single region.
80+
- **Geo-redundant**: Replicates data to a secondary region to ensure durability and availability.
81+
82+
https://github.com/user-attachments/assets/ea53958a-ca3e-4100-a527-d0e46cdb992e
83+
84+
#### Point-in-Time Restore (PITR)
85+
86+
> This feature allows you to restore your database to any point within the retention period, providing flexibility in case of accidental data loss or corruption.
87+
88+
> [!NOTE]
89+
> When you initiate a PITR, you specify the exact point in time to which you want to restore the database. <br/>
90+
> - The restore process uses the daily snapshots and transaction log backups to reconstruct the database state at the specified point in time.
91+
> - The restore operation `creates a new MySQL Flexible Server instance with the restored data`. You need to provide a new server name for the restored instance during the restore process
92+
93+
1. **Access the Azure Portal**: Navigate to your Azure Database for MySQL instance.
94+
2. **Restore**: Under the `Overview` section. Choose the `Restore` option and specify the point-in-time to which you want to restore your database.
95+
96+
<img width="550" alt="image" src="https://github.com/user-attachments/assets/d3ddc0e7-331d-44ec-b9e1-a3a38e54c325" />
97+
98+
https://github.com/user-attachments/assets/0eeb96cf-07c6-40f1-9921-64f2c775d228
99+
100+
### Manual Backups
101+
102+
> `Manual Backups` provide additional control over backup operations, allowing you to create backups on demand.
103+
104+
> [!IMPORTANT]
105+
> These backup files cannot be exported. The backups can only be used for restore operations in Azure Database for MySQL Flexible Server. You can also use [mysqldump](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/concepts-migrate-dump-restore#dump-and-restore-using-mysqldump-utility) from a MySQL client to copy a database.
106+
107+
#### On-Demand Backups
108+
109+
> You can create manual backups at any time. These backups are stored in geo-redundant storage (GRS) and can be used to restore your database to the state at the time of the backup.
110+
111+
1. **Access the Azure Portal**: Navigate to your Azure Database for MySQL instance.
112+
2. **Backup Settings**: Under the `Settings` section, select `Backup and Restore`.
113+
114+
<img width="550" alt="image" src="https://github.com/user-attachments/assets/e4aab7b9-4d16-4a5c-8817-6ccab7ec555e" />
115+
116+
3. **Backup Now**: Click on `Backup` and provide a custom name for the backup.
117+
118+
<img width="550" alt="image" src="https://github.com/user-attachments/assets/756a6512-267e-47a4-a2c5-4b182f4f28bd" />
119+
120+
https://github.com/user-attachments/assets/0f3743ca-9098-45a4-82c9-e67593e4ffcc
121+
122+
#### Exporting Data
123+
124+
> You can export your MySQL database using the `mysqldump` utility, which generates a logical backup of the database. This backup can be stored in Azure Blob Storage or downloaded locally for additional safety.
125+
126+
1. **Use `mysqldump` Command**: Open a terminal and run the following command. Click [here](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/concepts-migrate-dump-restore#dump-and-restore-using-mysqldump-utility) to get more information.
127+
128+
```bash
129+
mysqldump -u [username] -p[password] [database_name] > [dump_file.sql]
130+
```
131+
132+
2. **Upload to Azure Blob Storage**: Use Azure CLI or Azure Portal to upload the dump file to Azure Blob Storage.
133+
134+
### Backup Storage
135+
136+
> [!IMPORTANT]
137+
> By default Azure Database for MySQL Flexible Server backup storage is: <br/>
138+
> - Locally redundant for servers with same-zone high availability (HA) or no high availability configuration.
139+
> - Zone redundant for servers with zone-redundant HA configuration.
140+
141+
> [!NOTE]
142+
> - `Zone-redundant High Availability` to support zone redundancy is current surfaced as a `create time operation only`.
143+
> - `Zone-redundant High Availability server geo-redundancy` can only be `enabled/disabled at server create time`.
144+
145+
<img width="550" alt="image" src="https://github.com/user-attachments/assets/56387aee-7f18-4ffa-984d-ecd1c959304c" />
146+
147+
#### Backup Redundancy Option
148+
149+
| **Backup Redundancy Option** | **Description**| **Characteristics**| **When to Use**|
150+
|------------------------------|------------|------------------------|----------------------------|
151+
| **Locally Redundant Storage (LRS)** | - Multiple copies of backups are stored in the same datacenter.<br/>- Protects against server rack and drive failures.<br/>- Provides at least `99.999999999%` (11 9's) durability of backup objects over a given year.<br/>- Default for servers with same-zone HA or no HA configuration. | - Data replication within a single data center.<br/>- High durability within the same region.<br/>- Cost-effective.<br/>- Suitable for non-critical applications. | - When cost savings are a priority.<br/>- When the risk of regional outages is acceptable.<br/>- For servers with same-zone HA or no HA configuration. |
152+
| **Geo-Redundant Storage (GRS)** | - Multiple copies of backups are stored within the region and replicated to its geo-paired region.<br/>- Provides at least `99.99999999999999%` (16 9's) durability of backup objects over a given year.<br/>- Enabled at server create time for geo-redundant backup storage.<br/>- Can be moved from LRS to GRS post-creation.<br/>- Supported for servers in any Azure paired regions. | - Data replication across geo-paired regions.<br/>- Highest durability and availability.<br/>- Protection against regional disasters.<br/>- Ability to restore in a different region. | - For applications requiring the highest level of durability and availability.<br/>- When protection against regional disasters is critical.<br/>- When the ability to restore in a different region is needed. |
153+
| **Zone-Redundant Storage (ZRS)** | - Multiple copies of backups are stored within the availability zone and replicated to another availability zone in the same region.<br/>- Provides at least `99.9999999999%` (12 9's) durability of backup objects over a given year.<br/>- Selected at server create time for zone-redundant HA.<br/>- Backup storage remains zone-redundant even if HA is disabled post-creation. | - Data replication across multiple availability zones.<br/>- Higher availability and resilience against zone-level failures.<br/>- Meets data residency requirements within a country/region. | - For mission-critical applications requiring high availability.<br/>- When protection against zone-level failures is needed.<br/>- When data residency requirements must be met. |
154+
155+
## Disaster Recovery (DR) for MySQL on Azure
156+
157+
| **Category**| **Description**| **Technical Details**|
158+
|-----------------------|----------|--------------|
159+
| **Geo-Replication** | - **Read Replicas**: Azure Database for MySQL supports read replicas, which can be created in the same or different regions. These replicas can be promoted to standalone servers in case of a primary server failure.<br/>- **Cross-Region Replication**: This feature allows you to replicate your MySQL instance to a different Azure region, providing a robust DR solution. | - **Replication Method**: Uses MySQL's native binary log (binlog) file position-based replication.<br/>- **Creation**: Up to 10 replicas can be created.<br/>- **Promotion**: Replicas can be promoted to standalone servers.<br/>- **Cross-Region Replication Setup**: Requires primary and secondary servers in different regions. |
160+
| **Failover Strategies** | - **Automatic Failover**: In the event of a failure, Azure Database for MySQL can automatically failover to a read replica or a secondary instance, minimizing downtime.<br/>- **Manual Failover**: You can manually initiate a failover to a read replica or a secondary instance if needed. | - **Automatic Failover Configuration**: Enabled during server creation.<br/>- **Process**: Standby replica is activated to become the primary server.<br/>- **Manual Failover Steps**: Initiate failover via Azure Portal.<br/>- **DNS Update**: DNS record is updated to point to the new primary server. |
161+
| **High Availability (HA)** | - **Zone-Redundant HA**: Azure offers zone-redundant high availability, which ensures that your MySQL instance is replicated across multiple availability zones within a region. This setup provides resilience against zone-level failures.<br/>- **Regional HA**: For even greater resilience, you can configure your MySQL instance to be replicated across different regions. | - **Zone-Redundant HA Architecture**: Primary server in one availability zone, standby replica in another.`Uses zone-redundant storage (ZRS)`.<br/>- **Regional HA Architecture**: Primary server in one region, standby replica in another region. `Uses geo-redundant storage (GRS).` |
162+
163+
<div align="center">
164+
<h3 style="color: #4CAF50;">Total Visitors</h3>
165+
<img src="https://profile-counter.glitch.me/brown9804/count.svg" alt="Visitor Count" style="border: 2px solid #4CAF50; border-radius: 5px; padding: 5px;"/>
166+
</div>

0 commit comments

Comments
 (0)