locked
Sync Framework Design Questions RRS feed

  • Question

  • I have 3 databases, one in US, China and UK. I am using Sync framework to sync data.

    I have written C# code which uses an XML file to determine which databases and tables need to be synced. I run the code every two  hours and create a scope for every table (if doesn't exist).

    then I sync each scope. In XML file I make sure that primary key tables come first and foreign key tables come second.

    My end objective is that each node should have all the data (from all other nodes ) basically peer-to-peer replication model.

    My question is this

    1. Should I deploy my service only on 1 (say US) and let it do a upload and download synchronize on all other servers? OR should I deploy my service (which uses Sync framework) on every server.

    2. When Synchronizing, should the direction be Upload and Download or Just download? I mean technically if the service is deployed on each node, and each node downloads the changes from every other node... then the net effect should be the same right?

    3. One of my biggest concerns is that if I run my service on each node... what happens if by-chance each node tries to sync at the same time? (the schedules could overlap?). Is there a way in which I can detect this before starting the sync?

     

    Tuesday, March 1, 2011 9:06 AM

Answers

  • yeah you are right, if you installation happens on every node then using only upload will suffice. Alternatively, it will be interesting to see using only 'download'. i say this because - every node will try to download the data from it's peer's and the end result must be same.

    if performance is a parameter for you. it will be interesting to note how

    1) only upload does to performance

    2) upload + download does to performance (Is this one faster?)

     

    Alternatively, you can use 'uploadanddownload' at a single node - and other nodes will get synchronized.

    Do note the following scenario when you install uploadanddownload in a single node:

    suppose i have 1 Hub and 2 member database. (Code is installed on Hub)

    Now, Member1 is changed

    This changes will propagate to Hub

    Then this changes will propagate from Hub to Member2

    Please note the performance for your scenario before choosing the approach.

     


    - Paras Doshi, http://www.parasdoshi.com
    • Marked as answer by MSDN Student Monday, March 14, 2011 6:40 AM
    • Edited by Paras Doshi Monday, July 16, 2012 4:34 AM
    Sunday, March 13, 2011 1:48 PM

All replies

  • you can configure you're sync in a true peer-to-peer topology, but then each peer would have to be configured to connect to all other peers (in your case two other peers) and the sync will have to be run against each peer. the more peers you have, the more pairings you have too keep track and the more sync you need to run.

    i tend to use a hub-spoke topology by having the peers synchronized against a single, central peer. that way, each peer need only remember one pairing and need to sync only once. the caveat is if that central peer is down, you'll have to fall back to synching with another peer thats available.

    Tuesday, March 1, 2011 12:04 PM
  • Looks like you are needing GEO presence of your data.

    Have you looked at SQL Azure Data Sync? I know you probably have on-prem databases across the geographies, but do take a look at the service. This will do what you are asking and will be a no-code solution.


    This posting is provided AS IS with no warranties, and confers no rights
    Thursday, March 3, 2011 7:26 AM
  • 3rd party hosted clouds will not work for my org :)

    I have developed some code on Sync Framework and it seems to be working for me (atleast in the dev environment)

    I am still not sure when I should choose the direction as DownloadAndUpload or just upload.

    If the code which I have created is installed on every node, and each node periodically does an upload on every other node... then my databases should be in sync right. there is no need for me to do a uploadanddownload (or downloadandupload) on each node.

     

    Thursday, March 3, 2011 11:56 AM
  • yeah you are right, if you installation happens on every node then using only upload will suffice. Alternatively, it will be interesting to see using only 'download'. i say this because - every node will try to download the data from it's peer's and the end result must be same.

    if performance is a parameter for you. it will be interesting to note how

    1) only upload does to performance

    2) upload + download does to performance (Is this one faster?)

     

    Alternatively, you can use 'uploadanddownload' at a single node - and other nodes will get synchronized.

    Do note the following scenario when you install uploadanddownload in a single node:

    suppose i have 1 Hub and 2 member database. (Code is installed on Hub)

    Now, Member1 is changed

    This changes will propagate to Hub

    Then this changes will propagate from Hub to Member2

    Please note the performance for your scenario before choosing the approach.

     


    - Paras Doshi, http://www.parasdoshi.com
    • Marked as answer by MSDN Student Monday, March 14, 2011 6:40 AM
    • Edited by Paras Doshi Monday, July 16, 2012 4:34 AM
    Sunday, March 13, 2011 1:48 PM