Operational transformation

Post on 05-Dec-2014

6.743 views 5 download

description

 

Transcript of Operational transformation

Operational Transformation

The Secret behind Google Docs, Google Wave and Zoho Suite:

Who I am

Matteo Collina

Twitter: @matteocollina

Website: matteocollina.com

What do I do?

I study a lot..

CCAC North Library http://www.flickr.com/photos/ccacnorthlib/3554627894/in/photostream/ CC by 2.0

...and today I'll speak about whatI've studied!

CCAC North Library http://www.flickr.com/photos/ccacnorthlib/3554627894/in/photostream/ CC by 2.0

We will see...

We will see...

1. Why Real Time is cool

2. Why we are solving the wrong problem

3. An algorithm to rule them all

is all about interaction..

..between people,

that acts through Browsers,

that communicate through a server!

We can create new forms of collaboration!

There are LOTS of frameworks

There are LOTS of frameworks...

...and companies!

...and companies!Thanks!

The frameworks are solving

1. How we present the data to the user

2. How to transfer the data on the wire

Where is the interaction between

people?

What happens when they change the same

document?

Really?

Johannes Gilger http://www.flickr.com/photos/heipei/3236351860/

How can we handle

conflicts?Johannes Gilger http://www.flickr.com/photos/heipei/3236351860/

Can users understand

this?Johannes Gilger http://www.flickr.com/photos/heipei/3236351860/

We usually lock our documents to protect them!

Only the user that locked the document can edit it!

Some people are doing it correctly..

Some people are doing it correctly..

..how?

What happens when we edit a document?

Insert(0,"hello ")

Delete(6, 5)

Insert(6,"world")

s = "jsday"

s = "hello jsday"

Insert(0,"hello ")

s = "hello jsday"

s = "hello "

Delete(6, 5)

s = "hello "

s = "hello world"

Insert(6,"world")

The operations are processedas they arrive: what happens if there are more users sending them?

What happens if the operations come from

two users?

sA = "hello world" sB = "hello world"

sA = "hello world" sB = "hello world"

What happens if operations get

delayed?

sA = "hello jsday" sB = "hello world"

Operational Transformation

➡ has been a research topic for more than 20 years

➡ is a family of algorithms

❖ Jupiter has lead to Google Docs / Wave

Operational Transformation

Operational Transformation

1.reorders the operations

2.handles the conflicts between operations

3.garantees the same result on all nodes

Reorder Problem

How can we reorder the operations?

What is the intention behind

the delete?

s = "hello jsday"

s = "hello "

Delete(6, 5)

The intention behind the delete is to remove the "jsday" string

Delete(6, 5) Delete'(12, 5)

Insert(6,"world")

Delete(6, 5) Delete'(12, 5)

Insert(6,"world")

OT transposes the Delete through the Insert

s = "hello worldjsday"

s = "hello world"

Delete'(12, 5)

s = "hello worldjsday"

s = "hello world"

Delete'(12, 5)

OT is about changing where and how the ops

are executed

What happens if two users delete the same string?

Delete(6, 5) NoOperation

Delete(6, 5)

What happens if two users delete the same string?

Operational Transformation

reorders the operations

handles the conflicts between operations

garantees the same result on all nodes

Unfortunately, there is some nasty

math involved!

http://www.flickr.com/photos/oneaustin/1261907803

DEMO!!!

TL;DR

http://www.flickr.com/photos/evilaugust/3307382858

Operational transformation:• allows to build true real time

applications;• is really hard;• garantee the same results for

every users!

..but we started with a question!

What do I do?

• Ph.D. Student

• Software Engineer @ Mavigex

• Conference Speaker (?)

What do I do?

Choose your tools wisely!

http://www.flickr.com/photos/chuffy/186676221

Thank You!

Any Questions?