0
votes

I need to build a web application to work offline via Local Storage or IndexedDb.

I have schema v2 (for example a new table, or a new field added) on my server and schema v1 on my local app.

I need a way to synchronize my local schema (of course as soon as my offline app goes online). I store both definition and then compare them?

How can i synchronize them automatically, is there a tool or i have to do by coding?

1
will you allow users to put their data in the local storage ?Amol
so you will have to handle the logic in your code. you can also try using sqlite database. that way handling of data can be easier. you might as well send the file to the server once connected and then extract the data needed from that fileAmol
only mysql will not work since local / offline users will not have mysql installed. you will have to rely on indexdb / sqlite (something that will run within the browser)Amol
use a combination of key/value data store and indexdb to build your solution...essential parameters like DB version / creation date, etc can go in the key/value store and the actual data should go in the indexDBAmol
This should get you started diveintohtml5.info/storage.htmlAmol

1 Answers

1
votes

I suggest you should maintain DB version on both sides. Some parameter which is just a counter should also do the trick.

So that way you can check whether the local DB version is older than the one on the server. If that is true then update the DB else dont bother.