Data synchronization

22 views
Skip to first unread message

okwui

unread,
Feb 5, 2012, 3:12:31 AM2/5/12
to mobl
mobl is uses persistence.js. Does it implement the persistence.js
synchronization or is there another way to synchronize online and
offline data?

Chris Melman

unread,
Feb 16, 2012, 11:22:18 AM2/16/12
to mo...@googlegroups.com

 hi  okwui,
 
mobl doesn't support synchronisation at the moment, however there are some tricks available that make it a bit easier.
 
> Date: Sun, 5 Feb 2012 00:12:31 -0800
> Subject: [mobl] Data synchronization
> From: okwui...@gmail.com
> To: mo...@googlegroups.com

Brian Hayward

unread,
Sep 3, 2012, 2:04:53 AM9/3/12
to mo...@googlegroups.com
Wondering if you can point us to the tricks you have in mind.

Thanks,
Brian

Chris Melman

unread,
Sep 3, 2012, 6:29:43 AM9/3/12
to mo...@googlegroups.com

Hi Brian,

It depends a bit on what you want,
Currently the standard of html 5 database is not really concrete, that is probbably why there is currently no synchonisation tools through the database.
So that only leaves synchronisation through webservices, currently there are functions to convert from and to json with : fromSelectJSON and SelectJSON.
the from select json directly persist the data.
At the moment this is what can help you, However I'm currently working on synchronisation between WebDSL and mobl, this could deliver some extra features that may help you.

greetings Chris

Date: Sun, 2 Sep 2012 23:04:53 -0700
From: bhay...@gmail.com
To: mo...@googlegroups.com
Subject: Re: [mobl] Data synchronization

Brian Hayward

unread,
Sep 3, 2012, 4:44:39 PM9/3/12
to mo...@googlegroups.com
The task list example is a great starting point to describe the basic idea here.

Say we have two different people who wish to collaborate on the same task list.  What happens if tasks are changed while the device is offline?

It seems like this is a problem very similar to how a version control system works.

These things would have to be handled:
1. Track the last modify date for each item.
2. Track the last time this device synced.
3. On next sync, retrieve remote changes since last sync to apply to the local DB.
4. Send all local changes to the remote server to apply remotely.

But this seems to be device centric rather than server centric.

Maybe the solution would be better as more like a db change/redo log strategy.  If a device goes offline, the changes are maintained in a change log and streamed to the server when it comes back online.  The server would send updates from other devices back down as well.

Then, as a separate topic, we could discuss conflict resolution.
E.g. what if multiple folks edit the same task, who wins?  There is plenty of fun here (do we merge, do we just do something simple, what if two people add the same task?, etc). 

Thanks,
Brian

Chris Melman

unread,
Sep 4, 2012, 5:34:54 AM9/4/12
to mo...@googlegroups.com
Hi Brain,

Indeed for synchronisation I had something in mind like your list of steps, only mine is indeed more server centric.
the difference would be that the conflict resolution would take place on side of webserver and, simple flags on devices would be good enough instead of modify date. It also switches step 3 and 4.

there are a few reasons why I prefer the server centric solution:
one of the problems with dates on a other device is that you are not certain that the time is correct. Another reason  is that mobile devices are not so powerful. It also makes the conflict resolution harder if the devices on itself can decide what to do, this could even raise a second conflict resolution on the server.

your idea of logging is nice but is pretty complex if they use different database(schema's/backends). However if you want to use this, there is already a debug options that print all statements you could possibly hack somewhere to store them till next sync.

As you state the conflict resolution is a topic where you could have a good discussion, however there is not one answer to that problem.

I would have to say that if the idea described in your last mail is your goal, there is a lot of work to do which I probably won't cover with my implementation, this is mainly because of my server centric solution instead of your device centric solution.  However  I'm open for discussion

greetings Chris


Date: Mon, 3 Sep 2012 15:44:39 -0500

Subject: Re: [mobl] Data synchronization

Brian Hayward

unread,
Sep 5, 2012, 12:58:25 AM9/5/12
to mo...@googlegroups.com
Chris,

Agreed it does make sense to push most of the business logic to the server, if for nothing else than you don't have to write the code more than once.

It's an interesting discussion, thanks for taking the time to talk about it.

And BTW, I've done development with other web frameworks. ExtJS, jquery, jquery mobile, etc - and I just couldn't believe what I was seeing when I used mobl the first time.   Kudos to Zef and the rest of the team here for making something amazing. :)

Regards,
Brian

Chris Melman

unread,
Sep 5, 2012, 6:56:15 AM9/5/12
to mo...@googlegroups.com
Hi Brian,

I also thank you for your time, it gave me the opportunity to rethink and state more clear what I'm currently doing.

And we are glad to hear that you are so positive about mobl :)

greetings chris

Date: Tue, 4 Sep 2012 23:58:25 -0500
Reply all
Reply to author
Forward
0 new messages