First published on MSDN on Apr 19, 2018
SQL Server replication uses the publisher, distributor, and subscriber paradigm to provide logical data replication capability between different SQL Server instances, and sometime with heterogeneous data source or data destination. Replication uses the distribution databases hosted on a distributor to centrally manage and control the configuration and operation of data replication. While the actual data to be replicated are within user databases, SQL Server replication uses objects and artifacts outside the user databases, such as master database, msdb database, distribution databases, and even file systems.
SQL Server uses availability groups (AG) to provide physical data replication capability for a group of databases among a set of SQL Server instances. An availability group is self-contained such that all the databases to be replicated through the Availability Group are included as one unit.
Many enterprise customers have asked the capability to combine the usage of SQL Server replication and Always On, such that they can place replication distribution databases within an Always On AG to achieve high availability for their distribution databases, with the expectation that after doing so and when AG failover happens, SQL Server replication will continue functioning seamlessly and correctly. While the Replication publication and subscription databases can be configured to use Availability Groups, this support was lacking for the replication Distribution Databases.
SQL Server engineering team is excited to announce the new enhancement around the configuration of Replication Distribution Database in an Availability Group. This feature enhancement would be available with SQL Server 2017 CU6 and will be ported to SQL Server 2016 in a subsequent CU for SP2.
The improvement can help solve the following customer scenarios
-
High-Availability for Replication Distribution database
- The distribution database is the heart of the replication topology. The loss of the distribution database means that the entire topology stops receiving changes. The distribution server can be protected by a SQL Server FCI instance, but this provides only local HA but not site DR. To achieve site DR, the current recommended solution is to use geographically dispersed Failover Cluster Instances with storage level replication using
-
Either hardware-based SAN replication, which is prohibitively expensive for customers
-
Or using Windows 2016 S2D software-based SAN replication. While this provides a low-cost solution, this feature is not present in earlier versions of Windows and hence does not work for SQL server versions like SQL Server 2012 and SQL server 2014.
-
Minimize Upgrade/Migration Downtime
– Since SQL Server Replication depends heavily on server names, upgrade/migration of SQL Server instances hosting the replication distribution database requires re-deployment/re-setup of the entire replication topology. This is both time-consuming and requires substantial downtime. The improvement would help minimize the downtime and complexity to upgrade SQL Servers in a replication topology.
-
Standardize a single HADR solution across enterprise
– Majority of our Tier-1 customers are standardizing SQL Server Availability Groups as the solution of choice for their HADR requirements, except for replication distribution database, for which SQL Server FCIs were the only option. The new feature enhancement addresses this scenario.
Documentation around the feature capabilities and configuration details (along with Sample scripts) can be found
here
.
Supported Scenarios
-
Configuring distribution database to be included in an AG.
-
Configuring replication such as publications and subscriptions before and after AG failover.
-
Replication jobs functional before and after failover.
-
Removing replication at distributor and publisher when distribution database is in AG.
-
Adding or removing nodes to existing distribution database AG.
-
A distributor may have multiple distribution databases. Each distribution database can be in its own AG and or multiple distribution databases can be part of the same AG.
Feature Limitations and Restrictions
The following limitations and restrictions exists in the first release of the feature.
UPDATE 05/10
Starting with SQL Server Management Studio 17.7, Replication monitor supports registering a listener for scenarios where publisher database and/or distributor database is part of Availability Group. This feature requires the distribution database to be upgraded to SQL 2016 SP2 CU3 and above OR SQL 2017 CU6 and above.
Update 10/04
Starting with SQL Server 2016 SP2-CU3, this feature is now supported for SQL Server 2016.
Sourabh Agarwal
Senior PM, SQL Server Tiger Team
Twitter
|
LinkedIn
Follow us on Twitter:
@mssqltiger | Team Blog:
Aka.ms/sqlserverteam