What is the best way to sync between devices and cloud?

Hello everyone,


Thank you for reading my question and helping me find the solution.


This is my first post. I read the forum rules. I am sorry if I posted my question in wrong section.


Here are the basic requirements:

  1. App needs to run offline.
  2. Then sync data with cloud (our website database) at regular intervals.
  3. Must run between more than one devices and show latest data.
  4. You can assume the data file would be around 1MB.


Now, we are not sure when we should sync data with cloud and using what procedure.


We tried triggering the sync event when app goes in background and also when it comes back to screen. But this triggered the sync event a lot many times than required and is not practical. So, we removed these events. For now, we sync with cloud when:

  1. Either, user press sync button.
  2. Or logs out from app.


I both cases, we compare the latest time of the data file on local device and on the server(cloud), and tell him whats going to be overwritten by what. This give control in user's hand a bit and is working for us. And is good for multiple devices also.


But we still have few problem:


  1. Data gets lost if user removes the app without syncing or logging out.
  2. There are many users that ask this process to happen automatically at some frequency to make it smooth with multiple devices.
  3. Users get scared when they have to decide yes or no, before data is updated with latest on cloud or on local device.


So, basically we want to make this process more smooth and automatic and we are short of ideas on how to implement this. We have a feeling that many companies must be doing this automatically and there must be a standard way of doing this.


Can someone please help us with ideas and guide to the best way to implement this?


Thanks a ton.


Sincerely,

Manoj

Replies

But this triggered the sync event a lot many times than required and is not practical.

What do you mean by “not practical”?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi eskimo,


That means, it was syncronzing many times than required that was impractical like:

  1. Everytime when user shifts to another app or window and come back to this one.
  2. Evyetime, when user presses home button and come back to the app.

Imagine a syncronization circle everytime this happens for 4-5 seconds. And sometimes when internet conneciton is bad then it takes more than 4-5 seconds and returns bad internet connection message. And this an app that user needs to open several times a day to take notes and log stuff.


So, what I mean here is that this should be more in background. This should be run when there is some data to be sent to cloud.


Again, is there a standard method by which companies manage data between devices and cloud?


Thanks,

Manoj

Imagine a syncronization circle everytime this happens for 4-5 seconds.

Does that prevent the user using your app while it’s syncing?

And sometimes when internet conneciton is bad then it takes more than 4-5 seconds and returns bad internet connection message.

Does that message interrupt the user’s workflow?

If the answer to either of the above is yes then I suspect that you’d be better served by making your app more usable while syncing is in progress. My favourite example here is the built-in Mail app. It needs to keep its local view of the world is sync with the IMAP server, but the user can still browse, read and write emails while that’s happening.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"