Replication

44.1 Architecture: The Publishing Metaphor

Publisher (source) → Distributor (stores and forwards) → Subscriber (destination)

Publication = a set of articles (tables, views, procedures, filtered rows and columns)

Subscriptions: push (agents run at the distributor) or pull (agents run at the subscriber)

Agents: Snapshot Agent, Log Reader Agent, Distribution Agent, Merge Agent, Queue Reader

44.2 Replication Types

Full copy at intervals Small, rarely changing data Near-real-time changes from the log Reporting servers, scale-out reads

Geo-distributed writes (with conflict detection) Changes on both sides, with conflict resolution Disconnected/mobile clients

44.3 Monitoring and Troubleshooting

Replication Monitor, tracer tokens, sp_replcounters, distribution.dbo.MSrepl_errors

Common issues: missing primary keys (required for transactional), schema changes, latency, log growth (log_reuse_wait_desc = REPLICATION)