views:

1648

answers:

2

I am developping a mobile web application (for iPhone) with a local database (using html5 webstorage) so my app is still usable when the user is offline.

This is working perfectly, but I want to save the local data on a server. So I need to synchronize the local DB with a DB on a server. The synchronisation can only be one way, but in the future, I would like to synchronize it in the both way (server <-> local DB).

This requierement looks very common (or will be common in the future for mobile web app), but I can't find a library doing that.

I know google is doing that in their mobile web app (ex. gmail), and I found the WSPL project a google project but without source to download.

There is also [PersistJS] : a library to abstract HTML storage and gears DB, but it doesn't implement database sync.

If i can't find a solution, I will create a library to do that, as one way sync doesn't look difficult, but I wonder if there are other solutions.

+1  A: 

The open source project QuickConnect contains a JS library to synchronize the local HTML5 SQLite DB to a server DB (MySQL or other) :

http://quickconnect.pbworks.com/Using-Enterprise-Synchronization

It looks like it is exactly what I want. I ask if it was functionnal outside the QuickConnect Framework, and the author said yes, but I need to test it...

Samuel Michelot
Hi Samuel, did the js lib work out for you?
Mathias Lin
DB sync is not my priority for now, so I just give up, waiting for a more standard and robust solution...
Samuel Michelot
+1  A: 

I found another solution :

http://impel.simulacre.org/blog/transparently_synchronize_html5_databases.html

Looks great, but you will need to use Mootools library, and the Impel ORM...

Samuel Michelot