If you have a mobile app that has some data, how do you sync/backup? On demand as the blob comes in or wait and do it in the background? What's your pattern?
You can use WebSockets for real-time updates while you are connected to the server. If the device disconnects from the backend there should be an initialization process for getting fresh data.
atm it's direct link to api calls to and from the backend service.
This does, however, make the UI slightly less responsive as it waits for the data operations.
Future plan is to implement a more async method of using the offline data first, and then sync'ing with the backend in the background. It's a more complicated model though, so I've deferred the implementation in favor of shipping something usable sooner.
Of course if you use something that does that out of the box, then that's great (I think firestore SDK from amazon has something like this built in)
Yeah, this is what I'm going for. I'm offline first. I'm now working on upload using async in the background. Trying to figure out when to do it tho. While the user is using the app? Once the user closes the app? Or in the middle of the night?
I've built something like this before, and the strategy was as the user triggers the action - the DataManager would handle incoming requests, and queue them up in batches if the next incoming call came in while the current data sync was still busy.