Merge Replication with limited or unstable network bandwidth

Sunil Ferro 21 Reputation points
2022-04-18T13:30:59.137+00:00

Hi,

I have setup SQL Server Merge Replication using 3 SQL Servers (One Publisher, two Subscribers). It is configured to run continuously. All servers have the SQL Server 2016 Standard Edition. For testing purposes, I have used a database with one table. Replication is working from Publisher -> Subscriber and Subscriber -> Publisher. The concern is regarding Subscribers (client's end) having limited/unstable/no network bandwidth at certain times. If data is entered in multiple tables at the Subscriber's end and they have unstable bandwidth then how will Replication manage this? Will it ever insert/update records partially? Is there something that I need to do to handle this? Any suggestions that can be provided will help.

Thank you.

Developer technologies | Transact-SQL
SQL Server | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,586 Reputation points
    2022-04-19T07:20:02.137+00:00

    Hi @Sunil Ferro ,

    Welcome to Microsoft Q&A!
    Consider using the alternate snapshot folder and compressed snapshots on removable media for low-bandwidth networks.
    Compressing snapshot files in the alternate snapshot folder can reduce snapshot disk storage requirements and make it easier to transfer snapshot files on removable media.
    Compressed snapshots can, in some cases, improve the performance of transferring snapshot files across the network. However, compressing the snapshot requires additional processing by the Snapshot Agent when generating the snapshot files, and by the Distribution Agent or Merge Agent when applying the snapshot files. This may slow down snapshot generation and increase the time it takes to apply a snapshot in some cases. Additionally, compressed snapshots cannot be resumed if a network failure occurs; therefore they are not suitable for unreliable networks. Consider these tradeoffs carefully when using compressed snapshots across a network. For more information, see Modify snapshot options.

    If you are using merge replication over an unreliable network, consider using logical records, which ensures related changes are processed as a unit. For more information, see Group Changes to Related Rows with Logical Records.

    Here are the related document: Merge Replication
    Enhance General Replication Performance

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Tom Phillips 17,771 Reputation points
    2022-04-20T21:02:56.757+00:00

    Replication is an "asynchronous" process. The commands are stored in the "distribution" database and then applied on a schedule to the subscribers.

    It generally works fine in an environment where the connection is not stable. I would suggest you use a schedule, rather than "continuous" when you set it up. I would suggest 2 mins or 5 mins schedule. The advantage is you will get a log for every run. Otherwise, you never get the log until you stop the job. It will also restart if there is an error which causes it to stop.

    In merge replication, there is a possibility of "conflicts". You need to understand conflict resolution. See: https://learn.microsoft.com/en-us/sql/relational-databases/replication/merge/advanced-merge-replication-conflict-resolving-in-logical-record?view=sql-server-ver15

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.