The question:
Q: Is less expensive/more efficient for a Distributor
server to use 1 publication
to 2 subscribers
or to use 2 publications
with the same articles
going to a single subscriber
each?
Details:
We have been having an issue recently with our Transactional Replication
were the Distributor
to Subscriber
processes will halt an will not recovery gracefully. It is almost like some transactions get skipped or get applied out of order. Historically we have just resolved this with reinitializing
the publication
and moving on.
We have narrowed this down to a resource utilization issue on the Distributor
server. Most times we can resolve by restarting the server from Azure
but the larger publications
don’t always recovery on their own.
All of our articles
need to be delivered to two different servers (one for reporting functions owned by the IT department and another for reporting functions owned by a Data Analyst team). We will break the various articles into groups, each group getting 2 publications
and send them to our separate Distributor
server which accepts both Publications
. One publication
going to the IT server, the other going to the Data Analyst server. Something like below:
The resource utilization issue in part is due to expensive queries on the Data Analyst server blocking
the application of the replication
commands. We are working with that team to improve the queries but I also want to see if we can make an architecture adjustment to help.
I am looking to see if there is any reason why it would be less expensive for the Distributor
to send 1 publication
to 2 subscribers
instead of using 2 publications
going to a single subscriber
each. Something like below:
Does anyone have any experience with this potential kind of implementation?
The Solutions:
Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.
Method 1
I don’t think it’s should make much of a noticeable difference, but generally unless there’s a need for a second Publisher on the same Article (each using different row or column filters for example), there’s no reason to have two Publishers and would cause some slight extra work for the Distributor to manage two instead of one.
If my memory servers me correctly, Transactional Replication Distributors copy the commands for the transactions to replicate to the Subscriber server first, and then they’re applied. So if your issue is a locking / blocking one on one of the Subscribers, then that shouldn’t have anything to do with your Publisher to Distributor architecture anyway.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0