locked
How do I deploy my Sql Azure Sync Database RRS feed

  • Question

  • Hi,

    If I want to have a Sql Azure Database as the Hub and I want multiple clients to install a local database that can be synced to the HUB how is this done?  I have created a HUD Database in the Window Azure Portal but how do I setup multiple clients to sync to the HUB on there local machine?  Could I add a button on the client software that once clicked the database would sync any changes made to the Sql Azure Dabase HUB while they were offline?  I'm having a hard time finding much information on this subject.

    Thanks,

     

    Bryan K

    Tuesday, December 27, 2011 4:36 PM

Answers

  • For SQL Azure Data Sync, please refer to this wiki. You dont need to deploy a service here. You go to the portal and setup your sync group. You do download an agent on your local on-prem machine. This agent runs as a local NT service that communicates to the Data Sync Service hosted by us and keep the local on-prem DB and the SQL Azure DB in sync. Please refer to the wiki and it will give you a good idea on the scenario and the setup.

    Now for the toolkit, yes, you have to deploy the service on IIS or Windows Azure yourself and also write the client side code depending on your client devices. Again the site mentioned above and the sample will help you with the process.


    This posting is provided AS IS with no warranties, and confers no rights
    Wednesday, January 11, 2012 7:57 AM

All replies

  • Hi,

    You have a lot of info at http://social.technet.microsoft.com/wiki/contents/articles/sql-azure-data-sync-overview.aspx 

    or at Sync Framework site http://msdn.microsoft.com/en-us/sync

     


    Please mark the replies as answers if they help or unmark if not. Best Regards.

    Tuesday, December 27, 2011 4:46 PM
  • Vitor,

    Thanks for the reply.  I have read all I could from both these sites before I posted the question but I have not found the answer to my question on these sites.  If you know a direct link to the page on the site please post it.

     

    Thanks,

    Bryan K

    Tuesday, December 27, 2011 11:40 PM
  • Tuesday, December 27, 2011 11:59 PM
  • Vitor,

    Thanks for the reply.  I have looked at both of these pages you suggested but they do not fit my problem.  Once you Sync your database through the Azure Portal it does not appear you can use any of the methods that you have sent me to.   The method on the pages that you suggested appears to be for a database that has not already provisioned for syncing like my database is.  Here is my setup.

    1.  I have an on site database that we use to add and update data. 

    2.  I have made an Sql Azure Database in the Cloud and Sync it to my onsite database

    3. I want to install software on different mobile clients that will sync to the Cloud database.

     

    How is this done?

     

    Thanks,

    Bryan K.

    Wednesday, December 28, 2011 6:53 PM
  • Hi,

    What's a "mobile client" in your case? How many mobile clients?

     


    If you found this post useful, Please "Mark as Answer" or "Vote as Helpful". Best Regards.
    Wednesday, December 28, 2011 6:58 PM
  • We are working on a software application that runs on Windows OS that has pricing.  We want the user or what I call client to be able to install our software and be able to update their local database that the software installs when the client installed our software the first time.  The client may not have an internet connection all the time but when they did the could push a button that would sync the latest changes.  I hope this helps

     

    Thanks,

    Bryan K.

    Wednesday, December 28, 2011 7:18 PM
  • You can use Sync Framework 2.1 in order to sync client local database with a SQL Azure database (2-tier architecture). That sync can be on demand.

    You don't need SQL Azure Data Sync, you just need Sync Framework

     

    Try this one: http://msdn.microsoft.com/en-us/library/ff928617(v=SQL.110).aspx

     

    More info: http://jtabadero.wordpress.com/2011/06/28/synchronizing-with-sql-azure-using-sync-framework/


    If you found this post useful, Please "Mark as Answer" or "Vote as Helpful". Best Regards.
    Wednesday, December 28, 2011 7:53 PM
  • Actually there is more to it.

    Since you say you have 2 pieces -

    1. on-prem data needs to be in sync with a SQL Azure DB

    2. Mobile clients need to sync with the SQL Azure DB

    you have a few options:

    For #1 - like Vitor pointed out you could use the Sync framework and write some code to get your on-prem DB synced with the SQL Azure DB.

    However as you have already tried, you can use SQL Azure Data Sync which is a service that offers you the same capability with no coding involved on your end.

     

    For #2 - you can use the Sync Framework toolkit.

    See this post that describes the toolkit and the capabilities.

    Also you can download the toolkit from here.

    You would then host your own service either in IIS or Windows Azure and point it to your SQL Azure DB. Then your mobile clients can sync with the SQL Azure DB. Note that because you use multiple technologies here (assuming you use SQL Azure Data Sync and toolkit), you may have more metadata (internal tables, triggers etc). The advantage of the toolkit will be that you can sync with any clients devices.

    Hope it helps.

     


    This posting is provided AS IS with no warranties, and confers no rights
    Wednesday, December 28, 2011 8:35 PM
  • Thanks Vitor and Mahesh for your replies.

     

    I will look into both suggestions.

    Question to Mahesh.  In option #1 I have tried this and the Sql Azure Data Sync works on my local installed database but How would I deploy the same database to all the clients?  What is going on in the background a service?  How does this service get installed on the clients machine?  How would Sql Azure know how to find all the databases that are on my clients machine to sync each database?

     

    On Option #2 How would I find out more information on setting up the service on Windows Azure and pointing it to my Sql Azure DB?

     

    Thanks so much for yall's input.

     

    Bryan K.

     

     

    Wednesday, December 28, 2011 8:56 PM
  • @Mahesh

    For #2 he can run Sync Framework on the client's computer and use a SqlSyncProviver object to connect to the SQLAzure database right?

    This way he don't need to manually add all clients to Data Sync Service.


    If you found this post useful, Please "Mark as Answer" or "Vote as Helpful". Best Regards.
    Wednesday, December 28, 2011 9:04 PM
  • SQL Azure Data Sync does not support devices. You can only sync between SQL Azure DBs or between SQL Azure DB and local on-prem DBs.

    Like I said you could use Sync Framework 2.1 or SQL Azure Data Sync for your on-prem to SQL Azure sync part.

     

    For the part where you want your mobile clients to sync to a DB, you have to use the toolkit I mentioned above. SQL Azure Data Sync will not help you in that part. So you cannot deploy the DB to the client using SQL Azure Data Sync. You need to use teh toolkit. Please readup more on the toolkit and download the code. There are example apps and service components that can give you a start.

     

    Vitor, Sync Framework can be run on the clients as long as they are Windows desktop/laptop. If they are Windows phones, Windows Mobiles, Androids, iPhones etc, then Sync Framework 2.1 will not help as it is not ported to those platforms. Toolkit is a generic framework that can work with these clients.

    So if the clients constitute only Windows machines and they have SQL Server, then again yes, either Sync Framework or SQL Azure Data Sync can help.

    If the clients are going to be anything else, then toolkit has be used until SQL Azure Data Sync starts supporting the various clients natively.

     


    This posting is provided AS IS with no warranties, and confers no rights
    Wednesday, December 28, 2011 9:26 PM
  • Mahesh,

    So back to my question.  All users at this time will be using a Desktop or Laptop.

     

    In option #1 I have tried this and the Sql Azure Data Sync works on my local installed database but How would I deploy the same database to all the clients?  What is going on in the background a service?  How does this service get installed on the clients machine?  How would Sql Azure know how to find all the databases that are on my clients machine to sync each database?

    Wednesday, December 28, 2011 9:30 PM
  • That was my point, the advantage of Sync Framework running on clients computer (shipped inside your app) is that there's no need for Azure Sync Service manual deployment, you sync your clients database directly with Sync Framework.

    If you use Sync Service you have to manually add all clients to the service. New client means new add. With Sync Framework that step doesn't exist, all you need is to install the app on the client.


    If you found this post useful, Please "Mark as Answer" or "Vote as Helpful". Best Regards.
    Wednesday, December 28, 2011 9:39 PM
  • Sure, you can use Sync framework and deploy your app to all your clients and have the sync done that way.

    SQL Azure Data Sync just eliminates the writing of the app altogehter.

    If you are familiar with the Sync Framework, and dont mind coding, then by all means feel free to use it. Additionally for n-tier scenarios, you would need to host your own service either in IIS or on Windows Azure. If 2-tier is all you care about, then a simple Sync Framework can do the job for you. But since you talk about clients that could be mobile, I suspect you would need a n-tier app - at which point an already hosted service like Data Sync Service seems more suitable and saving you time and effort. Additionall it can offer you scheduled sync, monitoring and no central infrastructure to maintain. You can read about all the advantages and more on the wiki.

     

    And also you dont need to deploy the service itself with SQL Azure Data Sync. You just install the client agent and register your on-prem DBs in it. You create a sync group on the service and the service does the rest for you. How to get started gives you more details on that.

    And SQL Azure Data Sync is built on top of the sync framework BTW.


    This posting is provided AS IS with no warranties, and confers no rights
    Wednesday, December 28, 2011 11:14 PM
  • Mahesh,

    My software is an inventory software for coin collectors.  They download my software and if they like it they buy it.  I dont have any control over the client once they have installed the software.  So give this information which direction should I go?

     

    Thanks,

    Bryan K

    Thursday, December 29, 2011 4:09 PM
  • Since you are already writing an app, then maybe overall Sync Framework based solution is a better fit.

    Additionally depending on the amount of data you will have on the client, you could just have SQL Compact on the client.

    Just to reiterate your setup:

    One on-prem DB, one-azure DB, multiple windows clients (desktops or laptops).

    I am assuming that your clients are not fully connected to the backed DB always and hence a 2-tier app will not work, but a n-tier solution where clients can talk to a service and the service talks to your backend Azure DB.

    Given this, you will need to write a n-tier app using Sync Framework 2.1 SDK and redists. Note that we have already published a n-tier Windows Azure sample on our download center. You can base it on that. You app will know what to install on the client machine - meaning the sync framework bits, database, and your app itself during its setup.

    Once it does that, on running the app first time, it will bring down the initial DB (that you can configure in your app on what dataset to bring down to the client) and then there after your app can control the sync frequency etc.

    Now you still have a choice on how you sync your on-prem DB to the SQL Azure. You could use SyncFx 2.1 to write a simple app like I mention in the post and as did Vitor. Or you can use SQL Azure Data Sync and set it up which will do the job for you without needing you to code. But given that you are already writing one app, writing another one for on-prem to SQL Azure sync using SyncFx 2.1 should not be a big deal for you. You have a choice.

     

    Please refer to my previous posts in this thread if any of the topology factors change - meaning you will need to have one or more SQL Azure DBs, or need to start having non-windows clients or other devices as clients - then you may have to make use of additional technologies (in addition to your existing app)

    Lastly, just to help you understand, SyncFx 2.1 is the SDK and the core sync engine. And SQL Azure Data Sync, as well as the Sync Framework toolkit are all based on top of Sync Framework. They are all extensions to the Sync Framework core technology which provide the end user with value added services, ease of use, flexibility and extend the reach of clients.


    This posting is provided AS IS with no warranties, and confers no rights
    Thursday, December 29, 2011 7:23 PM
  • After giving some more thought on how I would like the client to sync with the sql azure database I think I would like to use a service.  Which toolkits and examples do I need to download and can this service be deployed with an installer like InstallAware?

     

    Thanks,

    Bryan K

    Tuesday, January 10, 2012 11:52 PM
  • if your clients are all on Windows on desktops/laptops, Sync Framework 2.1 using SqlSyncProvider and the Azure sample (http://code.msdn.microsoft.com/Windows-Azure-Sync-Service-60293622) mentioned by Mahesh would be enough as a starting point.

    if you have WP7 or non-windows clients, Sync Framework 2.1 and Sync Toolkit.


    btw, i have a list of links for SQL Azure synchronization here as well: http://jtabadero.wordpress.com/2011/06/28/synchronizing-with-sql-azure-using-sync-framework/
    • Edited by JuneTEditor Wednesday, January 11, 2012 12:35 AM
    Wednesday, January 11, 2012 12:32 AM
    Answerer
  • Hi Bryan,

    I am doing a cut-paste of my previous response here:

    Please follow the things I mentioned and see if this architecture is what gives you the scenairos you are looking for.

    The toolkit mentioned here is the Sync Framework toolkit.

     

    Actually there is more to it.

    Since you say you have 2 pieces -

    1. on-prem data needs to be in sync with a SQL Azure DB

    2. Mobile clients need to sync with the SQL Azure DB

    you have a few options:

    For #1 - like Vitor pointed out you could use the Sync framework and write some code to get your on-prem DB synced with the SQL Azure DB.

    However as you have already tried, you can use SQL Azure Data Sync which is a service that offers you the same capability with no coding involved on your end.

     

    For #2 - you can use the Sync Framework toolkit.

    See this post that describes the toolkit and the capabilities.

    Also you can download the toolkit from here.

    You would then host your own service either in IIS or Windows Azure and point it to your SQL Azure DB. Then your mobile clients can sync with the SQL Azure DB. Note that because you use multiple technologies here (assuming you use SQL Azure Data Sync and toolkit), you may have more metadata (internal tables, triggers etc). The advantage of the toolkit will be that you can sync with any clients devices.

    Hope it helps.


    This posting is provided AS IS with no warranties, and confers no rights
    Wednesday, January 11, 2012 12:38 AM
  • Thanks for the reply.  Would this be a service?  And can it be deployed?

     

    Thanks,

    Bryan K

    Wednesday, January 11, 2012 12:38 AM
  • Mahes,

     

    How would you deploy the aql azure data sync.  Is this information in the example?  I'm a newbee so I'm slow;)

     

    Bryan K

    Wednesday, January 11, 2012 12:48 AM
  • For SQL Azure Data Sync, please refer to this wiki. You dont need to deploy a service here. You go to the portal and setup your sync group. You do download an agent on your local on-prem machine. This agent runs as a local NT service that communicates to the Data Sync Service hosted by us and keep the local on-prem DB and the SQL Azure DB in sync. Please refer to the wiki and it will give you a good idea on the scenario and the setup.

    Now for the toolkit, yes, you have to deploy the service on IIS or Windows Azure yourself and also write the client side code depending on your client devices. Again the site mentioned above and the sample will help you with the process.


    This posting is provided AS IS with no warranties, and confers no rights
    Wednesday, January 11, 2012 7:57 AM
  • Ok thanks.  I'll read the articles and I'm sure I'll be back with questions if that is ok?

     

    Bryan K.

    Wednesday, January 11, 2012 2:46 PM