locked
Sync two Central Database RRS feed

  • Question

  • Hi Guys,

    I am new to Sync Framework.

    I am currently building a web application which has to be hosted in 2 different environment, and each has its own database.

    But this database have to be in sync. They are exactly same. Also people on each side will have do update and Insert.

    I do not know how I can handle this or is there a better way to sync the database? 

    I cannot do replication as these are 2 separate secured environments.   

     

    Any suggestions are welcomed. Let me know if more information is required

    Thursday, October 6, 2011 3:55 AM

Answers

  • you can write a sync application or a sync service and install on one of the environments and have it execute bidirectional sync on schedule.

    You can configure sync using WCF so you should not require direct connections to databases between sites and can have the sync over HTTP.

    see http://blogs.msdn.com/b/sync/archive/2010/10/07/windows-azure-sync-service-demo-available-for-download.aspx for an example, just change Azure sync service to a standard WCF service.

     

     

    • Marked as answer by vishalvatsal Wednesday, October 26, 2011 2:06 AM
    Thursday, October 6, 2011 5:32 AM
  • the ntier sample and the azure sync service sample are almost the same in terms of architecture. i just referred to the azure sample because it has a more detailed writeup compared to the other sample.

    am not sure what you refer to by separate layer.

    the ntier setup is just like any other sync setup with the only exception being one of the providers is hosted in another tier (WCF). it basically uses the same sync  providers.

    as for your error using the WCF Test client, afaik, the sample is using self hosting so make sure the service is up an running.

     

    • Marked as answer by vishalvatsal Wednesday, October 26, 2011 2:05 AM
    Wednesday, October 26, 2011 1:18 AM

All replies

  • you can write a sync application or a sync service and install on one of the environments and have it execute bidirectional sync on schedule.

    You can configure sync using WCF so you should not require direct connections to databases between sites and can have the sync over HTTP.

    see http://blogs.msdn.com/b/sync/archive/2010/10/07/windows-azure-sync-service-demo-available-for-download.aspx for an example, just change Azure sync service to a standard WCF service.

     

     

    • Marked as answer by vishalvatsal Wednesday, October 26, 2011 2:06 AM
    Thursday, October 6, 2011 5:32 AM
  • Hi June,

    I think I will have to start over from scratch. 

    Based on your suggestion I did had a look at the sample but then I also found the following sample  http://code.msdn.microsoft.com/Database-SyncSQL-Server-e97d1208

    Here is what I am trying to acheive  :   N-tier synchronization

    I tried the sample but could not get it running ( I have posted a query at http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/8c7ec346-1d1a-4f4b-9b04-ce43699b4a5b).

    Also based on N-Tier Synchronization will I need a separate layer for Client( SynchronizationAgent And Client Synchronization Provider  )  and Server (ServerProvider) ?

    And my WCF will be hosted on either client or server ?

    If I can get the sample running I can go ahead and try things but not sure why it is not working or I am missing something.

     

    Based on your experience if you think that the Azure sample will be better to implement or a better solution for what I want I would definitely give it a try.

    It would be great if you could help me.

    Thank you


     

     


     

     

     

    Wednesday, October 26, 2011 12:50 AM
  • the ntier sample and the azure sync service sample are almost the same in terms of architecture. i just referred to the azure sample because it has a more detailed writeup compared to the other sample.

    am not sure what you refer to by separate layer.

    the ntier setup is just like any other sync setup with the only exception being one of the providers is hosted in another tier (WCF). it basically uses the same sync  providers.

    as for your error using the WCF Test client, afaik, the sample is using self hosting so make sure the service is up an running.

     

    • Marked as answer by vishalvatsal Wednesday, October 26, 2011 2:05 AM
    Wednesday, October 26, 2011 1:18 AM
  • In the sample if I get rid of the self hosting bit i.e., convert it to Class library and the class,  should that not run normally in WCF Test Client?

    Wednesday, October 26, 2011 1:32 AM
  • Hi June, I have a question.

    I have a 2 projects in a solution

    • WCF Sync Service : It runs as a web service.
    • Client                   : Its a Win app that uses WCF Sync Service. I have referenced it as a service reference.

    The question here is where should the proxy classes SqlSyncProviderProxy sit.

    Do I have to place it in Client?

    Thank you for the time :)

    Friday, October 28, 2011 12:48 AM
  • if you're using the end-to-end sample, the proxy is directly referenced in the client.
    Friday, October 28, 2011 12:42 PM