Last post Sep 01, 2017 10:00 AM by AngelinaJolie
Aug 31, 2017 07:47 AM|f.a.rodriguez|LINK
I am developing a Web API using .Net Core 2.0. This will serve as the back-end for a phone app front-end being developed in IONIC 2. The app is a simple data capturing app. The requirement for this project is that the phone app must work in offline mode
(i.e. no data connectivity) and then when the user chooses (or when connected to a Wi-Fi) the phone app must sync the data to the Web API. So my Web API must have some sort of synchronization logic. Just for record, the database used will be MySQL.
I've been doing a little bit of research and I see there is a Microsoft Sync Framework. I was wondering if this is something that could work for me? Is it something that I would be able to make work in .Net Core? And if it works in a "phone app connecting
to Web API" scenario? Also, does anyone know if this framework is still being developed? I get the feeling it has been deprecated.
Alternatively, any pointers in the right direction would be greatly appreciated. It would be great to hear from the community before I start off in the wrong direction :) Thank you.
Aug 31, 2017 08:19 AM|Dmitry Sikorsky|LINK
I would implement something like command queue. Data is changed by commands. All commands have their ID (position in queue). Data also contains the ID of the last executed command. When you have connection, your app sends all the commands from local queue.
Server checks their IDs and executes new ones one by one.
If you have few clients it becomes more difficult. But if you just need to send captured data from device to the server (and the clients are independent), just populate it in the queue and then push to the server when have connection.
Sep 01, 2017 10:00 AM|AngelinaJolie|LINK
Syncing offline data to online data store
Before I tested , it used SQLite to store the data , user could add and show this data when user is offline , once use is online ,it could sync to database:
It seems on azure :https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started-offline-data
Hope it is helpful to you.