Back to results for “Architecture”
SQL Server › Replication

What roles do the publisher, distributor, and subscriber play in a transactional replication setup?

Intermediate

Answer

The publisher is the source database where the original data changes happen, the distributor is a special role, sometimes a separate server, that manages and forwards the captured changes, and the subscriber is the destination database that receives and applies those changes, together forming the complete replication pipeline from source to destination.
-- Configure the distributor first
EXEC sp_adddistributor @distributor = 'DistributorServer';

-- Then configure the publisher
EXEC sp_adddistpublisher @publisher = 'PublisherServer', @distributor = 'DistributorServer';
Real-world example A company sets up a dedicated distributor server separate from both the publisher and subscriber servers, reducing the processing load on their primary production database that acts as the publisher.

Common follow-ups: Can the distributor role run on the same server as the publisher?;What happens if the distributor server experiences downtime?