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: azure-sql/database/active-geo-replication-overview.md
+44-13
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Use active geo-replication to create readable secondary databases o
4
4
author: rajeshsetlem
5
5
ms.author: rsetlem
6
6
ms.reviewer: wiassaf, mathoma, arvindsh
7
-
ms.date: 09/13/2024
7
+
ms.date: 09/25/2024
8
8
ms.service: azure-sql-database
9
9
ms.subservice: high-availability
10
10
ms.topic: conceptual
@@ -27,7 +27,7 @@ Active geo-replication is designed as a business continuity solution. Active geo
27
27
28
28
The following diagram illustrates a typical configuration of a geo-redundant cloud application using Active geo-replication.
29
29
30
-
:::image type="content" source="media/active-geo-replication-overview/geo-replication-updated.png" alt-text="Diagram of active geo-replication." lightbox="media/active-geo-replication-overview/geo-replication-updated.png":::
30
+
:::image type="content" source="media/active-geo-replication-overview/geo-replication-updated.png" alt-text="Diagram of active geo-replication.":::
31
31
32
32
If for any reason your primary database fails, you can initiate a geo-failover to any of your secondary databases. When a secondary is promoted to the primary role, all other secondaries are automatically linked to the new primary.
33
33
@@ -105,14 +105,18 @@ To achieve full business continuity, adding database regional redundancy is only
105
105
106
106
If your secondary replica is used _only_ for disaster recovery (DR) and doesn't have any read or write workloads, you can designate the replica as [standby](standby-replica-how-to-configure.md) to save on licensing costs.
107
107
108
-
## <aid="preparing-secondary-database-for-failover"></a> Prepare for geo-failover
To ensure that your application can immediately access the new primary after geo-failover, validate that authentication and network access for your secondary server are properly configured. For details, see [Configure and manage Azure SQL Database security for geo-restore or failover](active-geo-replication-security-configure.md). Also validate that backup retention policy on the secondary database matches that of the primary. This setting isn't a part of the database and isn't replicated from the primary. By default, the geo-secondary is configured with a default PITR retention period of seven days. For more information, see [Automated backups in Azure SQL Database](automated-backups-overview.md).
111
113
112
114
> [!IMPORTANT]
113
115
> If your database is a member of a failover group, you cannot initiate its failover using the geo-replication failover command. Use the failover command for the group. If you need to failover an individual database, you must remove it from the failover group first. For more information, see [Failover groups overview & best practices (Azure SQL Database)](failover-group-sql-db.md).
Both the primary and geo-secondary are required to have the same service tier. It's also strongly recommended that the geo-secondary is configured with the same backup storage redundancy, [compute tier](./service-tiers-sql-database-vcore.md#compute) (provisioned or serverless) and compute size (DTUs or vCores) as the primary. If the primary is experiencing a heavy write workload, a geo-secondary with a lower compute size might not be able to keep up. That causes replication lag on the geo-secondary, and might eventually cause unavailability of the geo-secondary. To mitigate these risks, active geo-replication reduces (throttles) the primary's transaction log rate if necessary to allow its secondaries to catch up.
118
122
@@ -135,13 +139,29 @@ Review [license-free standby replica](standby-replica-how-to-configure.md) to le
135
139
136
140
## Cross-subscription geo-replication
137
141
138
-
Use Transact-SQL (T-SQL) or the [Databases Create or Update REST API](/rest/api/sql/databases/create-or-update) to create a geo-secondary in a subscription different from the subscription of the primary (whether under the same tenant of Microsoft Entra ID ([formerly Azure Active Directory](/entra/fundamentals/new-name)) or not). For more information, see [Tutorial: Configure active geo-replication and failover (Azure SQL Database)](active-geo-replication-configure-portal.md).
142
+
- You can use the Azure portal to setup Active geo replication across subscriptions as long as both the subscriptions are in the same Microsoft Entra ID tenant.
143
+
- To create a geo-secondary replica in a subscription *different* from the subscription of the primary in a different Microsoft Entra ID tenant, use [the geo-secondary across subscriptions and Microsoft Entra ID tenant T-SQL tutorial](active-geo-replication-configure-portal.md#cross-subscription-geo-replication).
144
+
- Cross-subscription geo-replication operations including setup and geo-failover are also supported using [Databases Create or Update REST API](/rest/api/sql/databases/create-or-update).
145
+
146
+
- Creating a cross-subscription geo-secondary on a logical server in the same or different Microsoft Entra tenant is not supported when [Microsoft Entra-only authentication](authentication-azure-ad-only-authentication.md) is enabled on either primary or secondary logical server and the creation is attempted using an Microsoft Entra ID user.
147
+
148
+
For methods and step-by-step instructions, see [Tutorial: Configure active geo-replication and failover (Azure SQL Database)](active-geo-replication-configure-portal.md).
149
+
150
+
## Private endpoints
151
+
152
+
Adding a geo-secondary using T-SQL is not supported when connecting to the primary server over a [private endpoint](private-endpoint-overview.md).
153
+
- If a private endpoint is configured but public network access is allowed, adding a geo-secondary is supported when connected to the primary server from a public IP address.
154
+
- Once a geo-secondary is added, [public network access can be denied](connectivity-settings.md#deny-public-network-access).
## <aid="keeping-credentials-and-firewall-rules-in-sync"></a> Keep credentials and firewall rules in sync
158
+
## Keep credentials and firewall rules in sync
141
159
142
160
When using public network access for connecting to the database, we recommend using [database-level IP firewall rules](firewall-configure.md) for geo-replicated databases. These rules are replicated with the database, which ensures that all geo-secondaries have the same IP firewall rules as the primary. This approach eliminates the need for customers to manually configure and maintain firewall rules on servers hosting the primary and secondary databases. Similarly, using [contained database users](logins-create-manage.md) for data access ensures both primary and secondary databases always have the same authentication credentials. This way, after a geo-failover, there are no disruptions due to authentication credential mismatches. If you're using logins and users (rather than contained users), you must take extra steps to ensure that the same logins exist for your secondary database. For configuration details, see [Configure and manage Azure SQL Database security for geo-restore or failover](active-geo-replication-security-configure.md).
You can scale up or scale down the primary database to a different compute size (within the same service tier) without disconnecting any geo-secondaries. When scaling up, we recommend that you scale up the geo-secondary first, and then scale up the primary. When scaling down, reverse the order: scale down the primary first, and then scale down the secondary.
147
167
@@ -154,14 +174,18 @@ You can scale up or scale down the primary database to a different compute size
154
174
> `The source database 'Primaryserver.DBName' cannot have higher edition than the target database 'Secondaryserver.DBName'. Upgrade the edition on the target before upgrading the source.`
155
175
>
156
176
157
-
## <aid="preventing-the-loss-of-critical-data"></a> Prevent loss of critical data
177
+
<aid="preventing-the-loss-of-critical-data"></a>
178
+
179
+
## Prevent loss of critical data
158
180
159
181
Due to the high latency of wide area networks, geo-replication uses an asynchronous replication mechanism. Asynchronous replication makes the possibility of data loss unavoidable if the primary fails. To protect critical transactions from data loss, an application developer can call the [sp_wait_for_database_copy_sync](/sql/relational-databases/system-stored-procedures/sp-wait-for-database-copy-sync-transact-sql) stored procedure immediately after committing the transaction. Calling `sp_wait_for_database_copy_sync` blocks the calling thread until the last committed transaction has been transmitted and hardened in the transaction log of the secondary database. However, it doesn't wait for the transmitted transactions to be replayed (redone) on the secondary. `sp_wait_for_database_copy_sync` is scoped to a specific geo-replication link. Any user with the connection rights to the primary database can call this procedure.
160
182
161
183
> [!NOTE]
162
184
> `sp_wait_for_database_copy_sync` prevents data loss after geo-failover for specific transactions, but does not guarantee full synchronization for read access. The delay caused by a `sp_wait_for_database_copy_sync` procedure call can be significant and depends on the size of the not yet transmitted transaction log on the primary at the time of the call.
163
185
164
-
## <aid="monitoring-geo-replication-lag"></a> Monitor geo-replication lag
186
+
<aid="monitoring-geo-replication-lag"></a>
187
+
188
+
## Monitor geo-replication lag
165
189
166
190
To monitor lag with respect to RPO, use the `replication_lag_sec` column of [sys.dm_geo_replication_link_status](/sql/relational-databases/system-dynamic-management-views/sys-dm-geo-replication-link-status-azure-sql-database) on the primary database. It shows lag in seconds between the transactions committed on the primary, and hardened to the transaction log on the secondary. For example, if the lag is one second, it means that if the primary is affected by an outage at this moment and a geo-failover is initiated, transactions committed in the last second will be lost.
167
191
@@ -172,11 +196,15 @@ To measure lag with respect to changes on the primary database that have been ha
172
196
>
173
197
> There are also conditions that could cause the difference between `last_commit` time on the geo-secondary and on the primary to become large. For example, if a commit is made on the primary after a long period of no changes, the difference will jump up to a large value before quickly returning to zero. Consider sending an alert if the difference between these two values remains large for a long time.
174
198
175
-
## <aid="programmatically-managing-active-geo-replication"></a> Programmatically manage active geo-replication
As discussed previously, active geo-replication can also be managed programmatically using T-SQL, Azure PowerShell, and REST API. The following tables describe the set of commands available. Active geo-replication includes a set of Azure Resource Manager APIs for management, including the [Azure SQL Database REST API](/rest/api/sql/) and [Azure PowerShell cmdlets](/powershell/azure/). These APIs support Azure role-based access control (Azure RBAC). For more information on how to implement access roles, see [Azure role-based access control (Azure RBAC)](/azure/role-based-access-control/overview).
178
204
179
-
### <aid="t-sql-manage-failover-of-single-and-pooled-databases"></a> T-SQL: Manage geo-failover of single and pooled databases
### T-SQL: Manage geo-failover of single and pooled databases
180
208
181
209
> [!IMPORTANT]
182
210
> These T-SQL commands only apply to active geo-replication and do not apply to failover groups. As such, they also do not apply to SQL Managed Instance, which only supports failover groups.
@@ -191,8 +219,9 @@ As discussed previously, active geo-replication can also be managed programmatic
191
219
|[sys.dm_operation_status](/sql/relational-databases/system-dynamic-management-views/sys-dm-operation-status-azure-sql-database)|Shows the status for all database operations including changes to replication links. |
192
220
|[sys.sp_wait_for_database_copy_sync](/sql/relational-databases/system-stored-procedures/sp-wait-for-database-copy-sync-transact-sql)|Causes the application to wait until all committed transactions are hardened to the transaction log of a geo-secondary. |
@@ -209,7 +238,9 @@ As discussed previously, active geo-replication can also be managed programmatic
209
238
> [!TIP]
210
239
> For sample scripts, see [Use PowerShell to configure active geo-replication for a database in Azure SQL Database](scripts/setup-geodr-and-failover-database-powershell.md) and [Use PowerShell to configure active geo-replication for a pooled database in Azure SQL Database](scripts/setup-geodr-and-failover-elastic-pool-powershell.md).
211
240
212
-
### <aid="rest-api-manage-failover-of-single-and-pooled-databases"></a> REST API: Manage geo-failover of single and pooled databases
Copy file name to clipboardExpand all lines: azure-sql/database/doc-changes-updates-release-notes-whats-new.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: WilliamDAssafMSFT
6
6
ms.author: wiassaf
7
7
ms.reviewer: mathoma, randolphwest
8
8
ms.service: azure-sql-database
9
-
ms.date: 09/18/2024
9
+
ms.date: 09/26/2024
10
10
ms.subservice: service-overview
11
11
ms.topic: whats-new
12
12
ms.custom:
@@ -89,6 +89,7 @@ Learn about significant changes to the Azure SQL Database documentation. For pre
89
89
90
90
| Changes | Details |
91
91
| --- | --- |
92
+
|**Cross-subscription geo-replica support in the Azure portal**| You can now use Azure portal to setup active geo-replication across subscriptions, as long as both the subscriptions are in the same Microsoft Entra ID tenant. For more information, see [Tutorial: Configure active geo-replication and failover (Azure SQL Database)](active-geo-replication-configure-portal.md).|
92
93
|**SQL Insights (preview) retirement**|[SQL Insights (preview) will be retired on 31 December 2024](https://azure.microsoft.com/updates/v2/sql-insights-retirement). We recommend that you transition to [database watcher for Azure SQL (preview)](../database-watcher-overview.md) or another database monitoring solution by that date. |
93
94
|**Hyperscale elastic pools GA**| Manage and scale multiple Hyperscale databases in Azure SQL Database by using [Hyperscale elastic pools](hyperscale-elastic-pool-overview.md). Hyperscale elastic pools also support Premium-series hardware and zone redundancy. For more information, see [Hyperscale Elastic Pools are now generally available](https://aka.ms/hsep-ga). |
94
95
|**Hyperscale elastic pool maintenance window support**|You can configure a non-default [maintenance window](maintenance-window.md) for a [Hyperscale elastic pool](hyperscale-elastic-pool-overview.md). For more information, read [Blog: Maintenance window support for Azure SQL Database Hyperscale elastic pools](https://aka.ms/hsep-fmw). |
0 commit comments