Skip to content

Instantly share code, notes, and snippets.

@famanson
Last active August 29, 2015 14:25
Show Gist options
  • Save famanson/0849424a86a002445888 to your computer and use it in GitHub Desktop.
Save famanson/0849424a86a002445888 to your computer and use it in GitHub Desktop.

We have a data sync controller:

  • Let the user store data about their travel locally (generated by another part of the app)
  • Let the user upload the local data to our backend endpoint
  • Let the user pull extra travel data from our webservice when they are online
  • The extra data from the webservice would eventually be merged with the local data and the user can view both at the same time

Our questions are:

  • How would you implement the sync controller with those data flows?
  • How would you decide when to sync the local data with the remote services? What are the battery consumption implications?
  • How would you deal with updating the views during data sync? For example, the sync might finishes and new data from the server is available when the user is trying to view the local data on the phone, how does the app deal with the local merge?

Extra notes:

  • Our backend servers run off Couchbase NoSQL database
  • We have a REST API for the app to talk to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment