Featured post
How to sync offline HTML5 webdatabase with centralised database -
i'd able following in html5 (ipad) web app:
- upload data online database (which <50mb in size if build online database in sqlite)
- extract either subset or full copy of data offline webdatabase
- (travel out of 3g network coverage range)
- perform bunch of analytic-type calculations on downloaded data
- save parameters calculations offline webdatabase
- repeat, saving different parameter sets several different offline analytic-type calculation sessions on extended period
- (head areas 3g network coverage)
- sync saved parameters offline webdatabase central, online database
i'm comfortable every step till last one...
i'm trying find information on whether it's possible sync offline webdatabase central database, can't find covering topic. possible this? if so, please supply link/s information on it, or describe how work in enough detail implement specific app?
thanks in advance
i haven't worked html5 local databases, have worked mobile devices require offline updates , resyncing central data store.
whether dataset created on server or on offline client, make sure primary key uuid. make sure timestamp record each time updated.
i make not of when last time offline client synced.
so, when resyncing central database, first query offline client records have changed since last sync. query central database determine if of records have changed since last sync.
if haven't changed on central database, update them data offline client. if records on server have changed since last sync, update them client.
if uuid not exist on central server on offline client, insert it, , vice versa.
to purge records, create "purge" column, , when sysnc query run, delete record each database (or mark inactive, depending on application requirements).
if both records have changed since last update, have either rely on user input reconcile or rule specifies record "wins".
i don't trust built-in database import functions, unless i'm importing empty database.
- Get link
- X
- Other Apps
Comments
Post a Comment