2 ms·
A bunch of research was done on this kind of problem in the 1990s under the heading "Operational Transformation".[1] Google have subsequently applied it to Wave
by jacques_chester 13y ago
A bunch of research was done on this kind of problem in the 1990s under the heading "Operational Transformation".[1] Google have subsequently applied it to Wave and Google Docs.
If you are prepared to accept some suckiness, you can probably do something simpler, borrowing partly from synchronous lockstep RTS simulations.
Put a single canonical model on your server. The server accepts command objects from clients, then forwards them to other clients. If each client is running the same code and applies the same command objects[2] in the same order, they will have identical local models.
It'll drift, of course. Periodically you need to do some sort of checksum and repair. But it's probably simpler than a fully-dressed OT system.
In terms of implementation, I'm working towards this sort of a system currently for an app I am trying to write. AngularJS on the front end, emitting command objects to a server which rebroadcasts to other clients. I don't have the details nailed down. For example, I don't have a firm concept of how or whether to try and coalesce multiple changes locally. And I don't have a firm view on the server system.
[1] http://en.wikipedia.org/wiki/Operational_transformation http://en.wikipedia.org/wiki/Operational_transformation
[2] http://en.wikipedia.org/wiki/Command_pattern http://en.wikipedia.org/wiki/Command_pattern
[3] http://www.altdevblogaday.com/2011/07/09/synchronous-rts-engines-and-a-tale-of-desyncs/ http://www.altdevblogaday.com/2011/07/09/synchronous-rts-eng...
- swah 13y agoIn some hyp. CMS, I considered just using a token, since the users just edit the same entity only occasionaly. The first one would hold the token (be able to edit the entity), and the other ones would just see and if they wanted, request a token to edit. Much simpler than OT/merging/etc, I thought... I wonder if it would work well.