android - Where to hold last sync time -


i have android application updated every 30 seconds retrieve latest messages server. use time-stamp holds seconds beginning of 2016 inside server database both user last sync , messages detect messages need delivered.

i afraid approach more safe hold sync time prevent losing data reasons disconnection or kind of error within sync process:

  1. current approach (hold last sync time on server)?
  2. hold last sync time in client database (is subject hack?)?
  3. defining custom process make sure data delivered (like online payments confirmation)?

generally speaking approaches servers , apis stateless.

by storing sync dates on server prevent user reinstalling or resetting app. since fetch latest data. might wanted approach (e.g. snapchat keep no history (at least on client)) if want list past data willl complicate things.

if chose store on client can more confident in user getting data needs. prevent attacks on servers should use other mechanisms. if user clears data, fetch required information again, since client knows when , update.

your third approach similar first one, more confidence on latest state. know user read , retrieved, still storing state on server.

all said, depends on actual goals , trying achieve.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -