You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/backup/backup-azure-linux-database-consistent-enhanced-pre-post.md
+30-25Lines changed: 30 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,37 @@
1
1
---
2
-
title: Database consistent snapshots using enhanced prepost script framework
3
-
description: Learn how Azure Backup allows you to take database consistent snapshots, leveraging Azure Virtual Machine (VM) backup and using packaged prepost scripts
2
+
title: Database consistent snapshots using enhanced prepost script framework for Azure Backup
3
+
description: Learn how Azure Backup allows you to take database consistent snapshots, using Azure Virtual Machine (VM) backup and packaged prepost scripts
4
4
ms.topic: how-to
5
5
ms.custom: linux-related-content
6
-
ms.date: 09/11/2024
6
+
ms.date: 08/21/2025
7
7
author: AbhishekMallick-MS
8
8
ms.author: v-mallicka
9
-
# Customer intent: "As a database administrator, I want to implement enhanced pre-post scripts for consistent snapshots on Linux VMs, so that I can achieve application consistency and optimize my backup strategy for performance and cost."
9
+
# Customer intent: "As a database administrator, I want to implement enhanced prepost scripts for consistent snapshots on Linux VMs, so that I can achieve application consistency and optimize my backup strategy for performance and cost."
10
10
---
11
11
12
12
# Enhanced prepost scripts for database consistent snapshot
13
13
14
-
Azure Backup service already provides a [_prepost_ script framework](./backup-azure-linux-app-consistent.md) to achieve application consistency in Linux VMs using Azure Backup. This process involves invoking a pre-script (to quiesce the applications) before taking
15
-
snapshot of disks and calling post-script (commands to un-freeze the applications) after the snapshot is completed to return the applications to the normal mode.
14
+
Azure Backup offers a built-in [_prepost_ script framework](./backup-azure-linux-app-consistent.md) to ensure application consistency for Linux VMs during backup. This framework automatically runs a prescript to quiesce applications before disk snapshots, and a postscript to restore applications to normal operation after the snapshot.
16
15
17
-
Authoring, debugging, and maintenance of the pre/post scripts could be challenging. To remove this complexity, Azure Backup provides simplified pre/post-script experience for marquee databases to get applicationconsistent snapshot with least overhead.
16
+
Managing custom pre/post scripts can be complex and time-consuming. To simplify this process, Azure Backup provides ready-to-use pre/post scripts for popular databases, enabling application-consistent snapshots with minimal effort and maintenance.
18
17
19
-
:::image type="content" source="./media/backup-azure-linux-database-consistent-enhanced-pre-post/linux-application-consistent-snapshot.png" alt-text="Diagram showing Linux application-consistent snapshot by Azure Backup.":::
18
+
The following diagram illustrates how Azure Backup uses enhanced prepost scripts to achieve application-consistent snapshots for Linux databases, ensuring reliable backup and recovery.
20
19
21
-
The new _enhanced_pre-post script framework has the following key benefits:
20
+
:::image type="content" source="./media/backup-azure-linux-database-consistent-enhanced-pre-post/linux-application-consistent-snapshot.png" alt-text="Diagram shows Linux application-consistent snapshot by Azure Backup.":::
22
21
23
-
- These pre-post scripts are directly installed in Azure VMs along with the backup extension, which helps to eliminate authoring and download them from an external location.
24
-
- You can view the definition and content of pre-post scripts in [GitHub](https://github.com/Azure/azure-linux-extensions/tree/master/VMBackup/main/workloadPatch/DefaultScripts), even submit suggestions and changes. You can even submit suggestions and changes via GitHub, which will be triaged and added to benefit the broader community.
25
-
- You can even add new pre-post scripts for other databases via [GitHub](https://github.com/Azure/azure-linux-extensions/tree/master/VMBackup/main/workloadPatch/DefaultScripts), _which will be triaged and addressed to benefit the broader community_.
26
-
- The robust framework is efficient to handle scenarios, such as pre-script execution failure or crashes. In any event, the post-script automatically runs to roll back all changes done in the pre-script.
22
+
## Key benefits of enhanced prepost script framework
23
+
24
+
The new _enhanced_ prepost script framework has the following key benefits:
25
+
26
+
- These prepost scripts are directly installed in Azure VMs along with the backup extension, which helps to eliminate authoring and download them from an external location.
27
+
- You can view the definition and content of prepost scripts in [GitHub](https://github.com/Azure/azure-linux-extensions/tree/master/VMBackup/main/workloadPatch/DefaultScripts), even submit suggestions and changes. You can even submit suggestions and changes via GitHub, which will be triaged and added to benefit the broader community.
28
+
- You can even add new prepost scripts for other databases via [GitHub](https://github.com/Azure/azure-linux-extensions/tree/master/VMBackup/main/workloadPatch/DefaultScripts), _which will be triaged and addressed to benefit the broader community_.
29
+
- The robust framework is efficient to handle scenarios, such as prescript execution failure or crashes. In any event, the postscript automatically runs to roll back all changes done in the prescript.
27
30
- The framework also provides a _messaging_ channel for external tools to fetch updates and prepare their own action plan on any message/event.
28
31
29
-
## Solution flow
32
+
## Solution flow of enhanced prepost script framework
33
+
34
+
The following diagram illustrates the solution flow of the enhanced prepost script framework for database consistent snapshots.
30
35
31
36
:::image type="content" source="./media/backup-azure-linux-database-consistent-enhanced-pre-post/solution-flow.png" alt-text="Diagram showing the solution flow.":::
32
37
@@ -39,7 +44,7 @@ The following the list of databases are covered under the enhanced framework:
39
44
40
45
## Prerequisites
41
46
42
-
You only need to modify a configuration file, _workload.conf_ in `/etc/azure`, to provide connection details. This allows Azure Backup to connect to the relevant application and execute pre and post-scripts. The configuration file has the following parameters.
47
+
You only need to modify a configuration file, _workload.conf_ in `/etc/azure`, to provide connection details. This allows Azure Backup to connect to the relevant application and execute pre and postscripts. The configuration file has the following parameters.
43
48
44
49
```json
45
50
[workload]
@@ -56,17 +61,17 @@ The following table describes the parameters:
56
61
57
62
|Parameter |Mandatory |Explanation |
58
63
|---------|---------|---------|
59
-
|workload_name | Yes | This will contain the name of the database for which you need application consistent backup. The current supported values are `oracle` or `mysql`. |
60
-
|command_path/configuration_path || This will contain path to the workload binary. This isn't a mandatory field if the workload binary is set as path variable. |
61
-
|linux_user | Yes | This will contain the username of the Linux user with access to the database user login. If this value isn't set, then root is considered as the default user. |
62
-
|credString || This stands for credential string to connect to the database. This will contain the entire login string. |
63
-
|ipc_folder || The workload can only write to certain file system paths. You need to provide here this folder path so that the pre-script can write the states to this folder path. |
64
+
|workload_name | Yes | This contains the name of the database for which you need application consistent backup. The current supported values are `oracle` or `mysql`. |
65
+
|command_path/configuration_path || This contains path to the workload binary. This isn't a mandatory field if the workload binary is set as path variable. |
66
+
|linux_user | Yes | This contains the username of the Linux user with access to the database user login. If this value isn't set, then root is considered as the default user. |
67
+
|credString || This stands for credential string to connect to the database. This contains the entire login string. |
68
+
|ipc_folder || The workload can only write to certain file system paths. You need to provide here this folder path so that the prescript can write the states to this folder path. |
64
69
|timeout | Yes | This is the maximum time limit for which the database will be in quiesce state. The default value is 90 seconds. It's not recommended to set a value lesser than 60 seconds. |
65
70
66
71
> [!NOTE]
67
72
> The JSON definition is a template that the Azure Backup service may modify to suit a particular database. To understand configuration file for each database, refer to [each database's manual](#support-matrix).
68
73
69
-
The overall experience to use the enhanced pre-post script framework is as follows:
74
+
The overall experience to use the enhanced prepost script framework is as follows:
70
75
71
76
- Prepare the database environment
72
77
- Edit the configuration file
@@ -79,16 +84,16 @@ The overall experience to use the enhanced pre-post script framework is as follo
79
84
80
85
Usually, streaming backups (such as full, differential, or incremental) and logs are used by database admins in their backup strategy. Following are some of the key pivots in the design.
81
86
82
-
-**Performance and cost**: A daily full + logs would be the fastest during restore but involves significant cost. Including the differential/incremental streaming backup type reduces cost but might impact the restore performance. But snapshots provide the best combination of performance and cost. As snapshots are inherently incremental, they have least impact on performance during backup, are restored fast, and also save cost.
87
+
-**Performance and cost**: A daily full + logs would be the fastest during restore but involves significant cost. Including the differential/incremental streaming backup type reduces cost but might impact the restore performance. But snapshots provide the best combination of performance and cost. As snapshots are inherently incremental, they have least impact on performance during backup, are restored fast, and also save cost.
83
88
-**Impact on database/infrastructure**: The performance of a streaming backup depends on the underlying storage IOPS and the network bandwidth available when the stream is targeted to a remote location. Snapshots don't have this dependency, and the demand on IOPS and network bandwidth is significantly reduced.
84
-
-**Re-usability**: The commands for triggering different streaming backup types are different for each database. So, scripts can't be easily re-used. Also, if you're using different backup types, ensure to evaluate the dependency chain to maintain the life cycle. For snapshots, it's easy to write script as there's no dependency chain.
89
+
-**Re-usability**: The commands for triggering different streaming backup types are different for each database. So, scripts can't be easily reused. Also, if you're using different backup types, ensure to evaluate the dependency chain to maintain the life cycle. For snapshots, it's easy to write script as there's no dependency chain.
85
90
-**Long-term retention**: Full backups are always beneficial for long-term retention0 as they can be independently moved and recovered. But, for operational backups with short-term retention, snapshots are favorable.
86
91
87
92
Therefore, a daily snapshot + logs with occasional full backup for long-term retention is the best backup policy for databases.
88
93
89
94
### Log backup strategy
90
95
91
-
The enhanced pre-post script framework is built on Azure VM backup that schedules backup once per day. So, the data loss window with Recovery Point Objective (RPO) as 24 hours isn’t suitable for production databases. This solution is complemented with a log backup strategy where log backups are streamed out explicitly.
96
+
The enhanced prepost script framework is built on Azure VM backup that schedules backup once per day. So, the data loss window with Recovery Point Objective (RPO) as 24 hours isn’t suitable for production databases. This solution is complemented with a log backup strategy where log backups are streamed out explicitly.
92
97
93
98
[NFS on blob](../storage/blobs/network-file-system-protocol-support.md) and [NFS on AFS (Preview)](../storage/files/files-nfs-protocol.md) help in easy mounting of volumes directly on database VMs and use database clients to transfer log backups. The data loss window that is RPO, falls to the frequency of log backups. Also, NFS targets don't need to be highly performant as you might not need to trigger regular streaming (full and incremental) for operational backups after you have a database consistent snapshots.
94
99
@@ -106,4 +111,4 @@ Once the database consistent snapshots are taken and the log backups are streame
106
111
107
112
## Summary
108
113
109
-
Using database consistent snapshots + logs backed up using a custom solution, you can build a performant and cost effective database backup solution leveraging the benefits of Azure VM backup and also re-using the capabilities of database clients.
114
+
Using database consistent snapshots + logs backed up using a custom solution, you can build a performant and cost effective database backup solution leveraging the benefits of Azure VM backup and also reusing the capabilities of database clients.
0 commit comments