Hi,
What is the best practice for syncing data from a mobile app to a backend when you have a large number of binaries to sync ?
The scenario is the following :
A mobile app must allow users to capture photos and videos while offline.
When the mobile app comes back online, it should send the offline data to the backend.
What would be the best approach : use the UploadFile action of the File Transfer plugin and in this case how to manage the sending of multiple files; or, as a second approach, trigger OfflineSyncData, retrieving image and video binaries via the File Plugin's GetFileData Action and using the default asynchronous data synchronization mechanism ?
Thank you in advance for your help on this subject.
Renaud
Could you tell me whether you are saving offline video or photo in a table in Apps local storage ?
Hi @Renaud Diez
In my opinion, you have 3 possible scenarios:
- one to many where multiple end users are not likely to change the same data applications are offline
https://success.outsystems.com/documentation/11/developing_an_application/use_data/offline/offline_data_sync_patterns/read/write_data_one_to_many/
- with conflict detection where several users change several data
https://success.outsystems.com/documentation/11/developing_an_application/use_data/offline/offline_data_sync_patterns/read/write_data_with_conflict_detection/
- or a simpler last recording date scenario
https://success.outsystems.com/documentation/11/developing_an_application/use_data/offline/offline_data_sync_patterns/read/write_data_last_write_wins/
link to the offline synchronization patterns page
https://success.outsystems.com/documentation/11/developing_an_application/use_data/offline/offline_data_sync_patterns/
Thank you for your reply Rahman, but it didn't really help me as I was aware of theses techniques and documentation. But nevertheless, let me share my current experience on the matter in order to provide you more context.
First of all, and to clarify the case, the recorded videos cannot be done by multiple users for the same footage. But the recorded videos must be attached to other entities' records.
In our experiment what we've done, and discovered so far, is:
We cannot benefit by default of the native offline data synchronization offered by the mobile app pattern as the maximum volume of data allowed is limited to 30Mb by sync, which is regularly the case for video footage. Another limitation of the native offline sync mechanism is the fact that large volume of data cannot be chunk in order to be sent more efficiently.
The only available option so far was to use the capabilities offered by the File Transfer Plugin in conjunction with the capabilities offered by the File Plugin.
Here is the followed implementation:
The last step described above is actually used because the File Transfer Plugin didn't manage a full background sync mechanism, contrary to what we understand from reading the documentation.
In addition of all of this, for the moment in ODC, when the different plugins (Camera Plugin, File Transfer Plugin and File Plugin) co-exist, a critical issue arises at the first installation of an app. Indeed, the File Plugin, in this case, is not able to write properly on the device. In order to work correctly, the user must close the app and re-open it, then everything works as expected for iOS. For Android, it is another story ... to be continued
Hi Renaud,
I am very interested in your use case and your "to be continued", as I have a similar scenario to implement.
Do you have any updates on the solution you implemented?
Best regards,
André Dinis