locked
Syncing user data with Azure RRS feed

  • Question

  • I am making a productivity app for Windows 8.1 and want to sync the users data across multiple devices so they are not restricted to having the data on 1 device. Their data is saved in a JSON string which I load into a WinJS binding list when the app starts. I then use JSON.stringify(list.slice(0)) to re-save the data.

    I am slightly confused about how to implement this function. Here are conclusions from my research: 

    1 - roaming folder only syncs 100KB which is too small and not designed for user data

    2 - skydrive is for user data not app data, saving it there may cause it to be accidentally deleted / corrupted. 

    Since finding built in functions cant serve me I have been researching "Windows Azure Mobile Service" which I think does what I want but I am just completely lost on the Azure website or other posts.

    Please could you clarify:

    Is the Azure Mobile Service correct for my needs?

    How I would sync the data with Azure?

    How the user would "login?" so they are accessing their .JSON file?

    Thank you very much



    • Edited by r.c.byrne Wednesday, February 19, 2014 6:48 PM
    Wednesday, February 19, 2014 6:47 PM

Answers

  • Yes, this is a good use for Azure Mobile Services.

    See  Get started with Mobile Services
    What exactly do you mean by "sync"? You can keep the data in a SQL table in your Mobile Service and query and update it as needed. If you need it also available offline then it's trickier as you'll need to keep an offline copy and then upload and download changes when online. How tricky this is depends on the data: atomic updates are fairly easy, but dealing with conflicts where multiple systems change the same data requires more thought.

    See Get started with authentication in Mobile Services
    Each row in the SQL table can have user column, and you can include that in your server-side query so only the user's rows are returned. The login itself can be set up to use several different identity providers (Microsoft Account, Facebook, etc.)

    --Rob

    • Marked as answer by r.c.byrne Wednesday, February 19, 2014 8:15 PM
    Wednesday, February 19, 2014 7:56 PM
    Moderator

All replies

  • Yes, this is a good use for Azure Mobile Services.

    See  Get started with Mobile Services
    What exactly do you mean by "sync"? You can keep the data in a SQL table in your Mobile Service and query and update it as needed. If you need it also available offline then it's trickier as you'll need to keep an offline copy and then upload and download changes when online. How tricky this is depends on the data: atomic updates are fairly easy, but dealing with conflicts where multiple systems change the same data requires more thought.

    See Get started with authentication in Mobile Services
    Each row in the SQL table can have user column, and you can include that in your server-side query so only the user's rows are returned. The login itself can be set up to use several different identity providers (Microsoft Account, Facebook, etc.)

    --Rob

    • Marked as answer by r.c.byrne Wednesday, February 19, 2014 8:15 PM
    Wednesday, February 19, 2014 7:56 PM
    Moderator
  • Wow thank you for the quick reply. This is exactly what I wanted. 

    By sync I mean have the latest version of the data on every device, and then if one device updates it apply these changes across every device. 

    I also want offline data and imagine it can get complicated if you have a conflicts but I will worry about that later. Can i insert the data into the table in the JSON format? or do I need to convert it?

    • Edited by r.c.byrne Wednesday, February 19, 2014 8:24 PM
    Wednesday, February 19, 2014 8:15 PM
  • Which to start with really depends on your needs. You can't go wrong with the free trial, and for light usage there is a Free tier for Windows Azure Mobile Services. See Mobile Services Pricing Details
    Wednesday, February 19, 2014 8:27 PM
    Moderator