Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Question: why did you choose Commutative Replicated Data Structures over OT? #1

Open
ugin opened this Issue Feb 19, 2013 · 1 comment

Comments

Projects
None yet
2 participants

ugin commented Feb 19, 2013

Why did you choose Commutative Replicated Data Structures over OT?

I've studied OT and tried to implement into github.com/substance/surface last year, but didn't make it cause my job was too demanding.

Is there a short answer why you think this is a better approach?

P.S. I didn't get to read the documents you've linked, I'm planning this weekend.

Owner

dominictarr commented Feb 19, 2013

The main reason is because I already had bunch of modules for CRDT stuff, and I wanted to see if I could adapt it to collaborative editing.

This is just a basic job, with room for improvement, I spent only 1.5 days getting this running.

The second reason is because there where no OT libs that exposed streams properly.
The best pattern to use is the duplex stream:

var editor = CollabEditorThing()

var stream = net.connect() //get a tcp connection somehow
stream.pipe(editor.createStream()).pipe(stream)

Using this pattern completely decouples your thing from a particular style of IO,
so it will work over tcp, http, websockets, websocket fallbacks, stdio, anything that is a stream!

The OT libs I was currently aware of unfortunately wrapped a particular sort of server, so it hard to drop into your application.

cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment