21 April 2015

Mirroring with Replication in SQL Server

In SQL server environment, we can configure combination of HA features. Like Mirroring with log-shipping or Mirroring with Replication.

If you go through with below scenario you can understanding very well.


Setup
If you followed the link above, BOL provides a basic listing of the order to setup mirroring with replication.
  1. Configure the Publisher.
  2. Configure database mirroring.
  3. Configure the mirror to use the same Distributor as the principal.
  4. Configure replication agents for failover.
  5. Add the principal and mirror to Replication Monitor.
We will follow these steps while adding in a few catches and added details that need to be configured to ensure processing flows while not in a failover situation and after a failover situation.
Mirroring and Replication Landscape
In the end, the solution shown in the following diagram will be achieved.
From the above diagram, you can see that three servers are involved. Server A acts as the principal as well as the publisher.
  • Principal: The primary server in mirroring
  • Mirror: The secondary server in mirroring
  • Publisher: The primary source of replication
  • Subscriber: The subscription to the published data in replication
To follow the setup order, the first task is to setup the publisher in transactional replication. This server also acts as the principal in mirroring (which will be setup later).