Tuesday, March 10, 2015

Replication Definitions and types

Replication:-

===========

Replication is nothing but transfering the data from one server to another server. this is mainly used for reporting purpose.
Article:
========= The article is the information that is going to be replicated. It could be a table, a procedure or a filtered table etc.
Publisher:
========== The publisher is the database on the source server which is actually replicating the data. The publication which is collection of articles (various objects in the database) is published by the publisher.
Distributor:
============ The distributor is a mediator between publisher and subscriber,mainly responsible for transfering the data. The distributor could himself be a publisher or a subscriber.

when we configure distributor, we will get a system database named"distributor'.

Subscriber:
=========== Subscriber is the end receiver of the publication who gets the data in the form of subscriptions. The changes published are propagated to all the subscribers of the publications through the distributor. The subscriber simply has to create a subscription on the publication from its end to receive the data.

There are various types of replication:

Snapshot Replication
Merge replication
Transactional Replication(with update subscibers)
peer to peer replication

Snapshot Replication:
====================  Snapshot replication is initiated at first by all types of replication to initialize subscribers.  In this method of replication, entire data will be captured and sent to the subscriber. What happens in this replication is, all the changes that occur in the publisher will be captured and then later sent to the subscriber when the snapshot agent runs again.  Snapshot agent and distribution agents are used in the snapshot replication. 
Merge Replication:
================= Merge replication is the process of distributing data from publisher to the subscriber. In the merge replication, updates are allowed even when subscriber or publisher are connected or disconnected. If they are disconnected, the updates will be applied when both get connected.  Merge agent and snapshot agent is used in merge replication. Merge replication is the most difficult replication method to implement and manage. 
Transactional Replication:
========================= In transactional replication, all changes made in the publisher are captured and stored in the distribution database, and then these changes are transferred to the subscriber database. The best situation to use transactional replication is when data changes frequently and data is transferred to the subscriber immediately as in almost real time scenario. 
Peer-Peer Replication:
======================= Peer-Peer replication is built on the foundation of the transactional replication. This replication method is introduced in SQL Server 2005. This replication is available only in SQL Server Enterprise Edition. Peer-to-Peer replication provides high availability solution by providing multiple copies of databases across multiple instances. 

Agents
======
Snapshot Agent: Snapshot agent is used in all types of replication. This agent takes the snapshot of all the database schema and data that needs to be replicated from publisher to the subscriber. Snapshot.exe executes in the distributor server.

 Log Reader Agent: Log reader agent is used only in transactional replication. All the committed transactions from the transaction log of publisher database will be extracted. Once the data is being extracted from the transaction log of the publisher database, log reader agent makes sure that each transaction is written into the distribution database  of the distributor server, and the data should be written in the same sequence as that of the transaction sequence made in the publisher database. This sequence is very critical to keep the data consistency and keep the transactions out of order. Logread.exe is the executable for this agent.

Distribution Agent:
Distribution agent is used in snapshot and transactional replication. Distrib.exe is the executable for this agent. Distribution agent serves two purpose: Apply snapshots at the initial stage of replication initialization process and to send transactions from distribution database to the subscriber.

Merge Agent:
Merge agent is used only with merge replication. The main function of merge agent in merge replication method is to apply the snapshot that is generated when the subscriber is initialized at first during the replication process. Replmerg.exe is an executable for this agent and this agent runs behind the scene to finish the replication process successfully.

Queue Reader Agent:

The main function of queue reader agent is to transfer or send the queue from the subscriber to the publisher. Qrdrsvc.exe is an executable for this agent.

+++++  ++++ ++++













No comments:

Post a Comment

COMMON SQL SERVER BACKUP FAILURE ERRORS AND ISSUES

  One of the most common task for a DBA’s are to perform installation of new SQL Server versions and installing patches. Most often or not e...