Merge replication to keep SQL Server databases in sync

I have a number of tool vending machines all connected to a SQL Server database to record stock levels and transactions. One of these vending machines is connecting to the SQL Server database through an ADSL link and is constantly experiencing loss of connection between it and the database.

What I've been thinking is to host a copy of the database on the vending machine using the ADSL link and then having the two databases do a two-way sync every couple of hours. My problem is due to my lack of knowledge and experience with SQL Server databases.

The idea of having a local database that syncs when scheduled is to minimize the WAN connectivity issues. What's the best way to proceed?

    Requires Free Membership to View

Based on the information you provided, it sounds like merge replication will be a good solution to help you resolve your issue.

When setting up the articles within the publication, I would recommend filtering any large tables to download only records which are used by this specific vending machine. This will help you reduce your network traffic to this vending machine. You can then schedule the merge to take place on a schedule, so changes are replicated between the two databases. If records are updated at each database, you'll need to be careful when setting up your conflict resolution so that you can keep an accurate inventory.

Check out this helpful tip:   
  • How merge replication works
    Find out exactly how merge replication works in this tip, the first in a three-part series by contributor Hilary Cotter.
  • This was first published in December 2007

    Join the conversationComment

    Share
    Comments

      Results

      Contribute to the conversation

      All fields are required. Comments will appear at the bottom of the article.