Question

Looking at all the examples of Operational Transformation Frameworks out there, they all seem to resolve around the transformation of changes to plain text documents. How would an OT framework be used for more complex objects?

I'm wanting to dev a real-time sticky notes style app, where people can co-create sticky notes, change their positon and text value. Would I be right in assuming that the position values wouldn't be transformed? (I mean, how would they, you can't merge them right?). However, I would want to use an OT framework to resolve conflicts with the posit-its value, correct?

Was it helpful?

Solution

I do not see any problem to use Operational Transformation to work with Complex Objects, what you need is to define what operations your OT system support and how concurrency is solved for them

For instance, if you receive two Sticky notes "coordinates move operation" from two different users from same 'client state', you need to make both states to converge, probably cancelling out second operation.

This is exactly the same behaviour with text when two users generate two updates to delete a text range that overlaps completely, (or maybe partially), the second update processed must be transformed against the previous and the resultant operation will only effectively delete a portion of the original one, (or completely cancelled with a 'no-op')

You can take a look on this nice explanation about how Google Wave Operational Transformation works and guess from this point how it should work your own implementation

OTHER TIPS

See the following paper for an approach to using OT with trees if you want to go down that route:

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.100.74

However, in your particular case, I would use a separate plain text OT document for each stickynote and use an existing library, eg: etherPad, to do the heavy lifting. The positions of the notes could then be broadcast on a last-committer-wins basis.

Operation Transformation is a general technique, it works for any data type. The point is you need to define your transformation functions. Also, there are some atomic attributes that you cannot merge automatically like (position and background color) those will be mostly "last-update wins" or the user solves them manually when there is a conflict.

there are some nice libs and frameworks that provide OT for complex data already out there:

  • ShareJS : library for Node which provides all operations on JSON objects
  • DerbyJS: framework for NodeJS, it uses ShareJS for OT stuff.
  • Open Coweb framework : Dojo foundation project for cooperative web applications using OT
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top