android application offline mode, local sqlite database synchronisation with distant database android application offline mode, local sqlite database synchronisation with distant database postgresql postgresql

android application offline mode, local sqlite database synchronisation with distant database


Here are some very basic thoughts on this.

In an ideal case, you'd sync in general working meta-data and your off-line mode would allow insert-only workflows adding new data based on that metadata. This would make it fairly easy to sync things through later by merely posting to a web service sequentially and then flagging as such in the db or removing the rows altogether.

If you go with something like that, you probably don't really want to approach sqlite as an rdbms. What you probably want is a wide table structure designed mostly to store pending requirests, or something that will store things like json payloads you will send later. This means your local db will be designed not around your data model but around your web service API.

If you have to get into update (overwriting workflows) then you need to put a lot of effort into conflict resolution but the same basically applies. You probably want to add a lot more information like timestamps and other conflict-resolution-related data.

From there however you should be able to re-use your application API to do the sync rather than looking for a specific tool to do it.