Slide 1

Slide 1 text

\o/ WOOT for Lift Richard Dallaway @d6y Jono Ferguson @jonoabroad

Slide 2

Slide 2 text

Richard Dallaway @d6y

Slide 3

Slide 3 text

Collaborative Editing

Slide 4

Slide 4 text

Don’t Do This A B C A B C Site A Site B 1 2 3 1 2 3

Slide 5

Slide 5 text

Don’t Do This A B C A B C Site A Site B 1 2 3 1 2 3 A x B C 1 2 3 4 insert x @ 2

Slide 6

Slide 6 text

Don’t Do This A B C A B C Site A Site B 1 2 3 1 2 3 A x B C 1 2 3 4 insert x @ 2 A B 1 2 delete 3

Slide 7

Slide 7 text

Don’t Do This A B C A B C Site A Site B 1 2 3 1 2 3 A x B C 1 2 3 4 insert x @ 2 A B 1 2 delete 3 A x B

Slide 8

Slide 8 text

Don’t Do This A B C A B C Site A Site B 1 2 3 1 2 3 A x B C 1 2 3 4 insert x @ 2 A B 1 2 delete 3 A x B A x C

Slide 9

Slide 9 text

What do we want? ‣Intention Preservation ‣Causal Consistency ‣Convergence When do we want it? Eventually

Slide 10

Slide 10 text

The WOOT Algorithm

Slide 11

Slide 11 text

WOOT A B C A B C Site A Site B 1 2 3 1 2 3

Slide 12

Slide 12 text

WOOT A B C A B C Site A Site B 1 2 3 1 2 3 1 2 3 4 A x B C A ≺ x ≺ B

Slide 13

Slide 13 text

WOOT A B C A B C Site A Site B 1 2 3 1 2 3 1 2 3 4 A x B C A ≺ x ≺ B 1 2 A B delete C

Slide 14

Slide 14 text

WOOT A B C A B C Site A Site B 1 2 3 1 2 3 1 2 3 4 A x B C A ≺ x ≺ B 1 2 A B delete C A x B

Slide 15

Slide 15 text

WOOT A B C A B C Site A Site B 1 2 3 1 2 3 1 2 3 4 A x B C A ≺ x ≺ B 1 2 A B delete C A x B A x B

Slide 16

Slide 16 text

WChar ID Prev Next Alpha Visible?

Slide 17

Slide 17 text

WChar ID Prev Next Alpha Visible? Site Clock

Slide 18

Slide 18 text

WChar ID Prev Next Alpha Visible? Site Clock ID ID

Slide 19

Slide 19 text

WOOT Algorithm Local Integration Remote Integration

Slide 20

Slide 20 text

WOOT Algorithm (WString, Char, Pos) => 
 (WString, WChar) Local Integration Remote Integration

Slide 21

Slide 21 text

WOOT Algorithm (WString, Char, Pos) => 
 (WString, WChar) Local Integration (WString, WChar) => WString Remote Integration

Slide 22

Slide 22 text

WOOT Algorithm a b c d a b c d a b c d a b c x d a c d a b y c d

Slide 23

Slide 23 text

WOOT Algorithm a b c d a b c d a b c d a b c x d a c d a b y c d a b c d

Slide 24

Slide 24 text

WOOT Algorithm a b c d a b c d a b c d a b c x d a c d a b y c d a b c d x

Slide 25

Slide 25 text

WOOT Algorithm a b c d a b c d a b c d a b c x d a c d a b y c d a b c d x /

Slide 26

Slide 26 text

WOOT Algorithm a b c d a b c d a b c d a b c x d a c d a b y c d a b c d x y /

Slide 27

Slide 27 text

Example using Ace

Slide 28

Slide 28 text

Scala, JavaScript, Lift WOOT Local WOOT Model

Slide 29

Slide 29 text

Scala, JavaScript, Lift WOOT x Local WOOT Model

Slide 30

Slide 30 text

Scala, JavaScript, Lift WOOT x Local WOOT Model A ≺ x ≺ B

Slide 31

Slide 31 text

Scala, JavaScript, Lift WOOT WOOT WOOT x Local WOOT Model A ≺ x ≺ B

Slide 32

Slide 32 text

Scala, JavaScript, Lift WOOT WOOT WOOT x Local WOOT Model A ≺ x ≺ B

Slide 33

Slide 33 text

Scala, JavaScript, Lift WOOT WOOT WOOT x x x Local WOOT Model A ≺ x ≺ B

Slide 34

Slide 34 text

Fork It bitbucket.org/d6y/woot

Slide 35

Slide 35 text

Fork It bitbucket.org/d6y/woot $ git clone https://[email protected]/d6y/woot.git $ ./sbt > container:start

Slide 36

Slide 36 text

Fork It bitbucket.org/d6y/woot $ git clone https://[email protected]/d6y/woot.git $ ./sbt > container:start

Slide 37

Slide 37 text

JavaScript jQuery(document).ready(function() { wootServer.init({doc:1}).then(messageHandler); });

Slide 38

Slide 38 text

JavaScript jQuery(document).ready(function() { wootServer.init({doc:1}).then(messageHandler); }); var wootServer = { init: function(config) { return $.Deferred().promise(); }, send: function(wchar) {} };

Slide 39

Slide 39 text

JavaScript jQuery(document).ready(function() { wootServer.init({doc:1}).then(messageHandler); }); var wootServer = { init: function(config) { return $.Deferred().promise(); }, send: function(wchar) {} };

Slide 40

Slide 40 text

Scala def services = List[RoundTripInfo]( "send" -> receive _, "init" -> init _)

Slide 41

Slide 41 text

Scala def services = List[RoundTripInfo]( "send" -> receive _, "init" -> init _) def init(config: JValue) : Stream[JValue] = { ! 
 ! }

Slide 42

Slide 42 text

Scala def services = List[RoundTripInfo]( "send" -> receive _, "init" -> init _) def init(config: JValue) : Stream[JValue] = { ! 
 ! } val doc = toJson(wootModel) val q = LinkedBlockingQueue[JValue]() doc #:: Stream.continually(q.take())

Slide 43

Slide 43 text

Pros ‣No vector clocks ‣Simple
 LoC Scala JavaScript Model 100 200 Glue 100 100

Slide 44

Slide 44 text

Cons ‣Bulk operations ‣Space
 ‣No GC


Slide 45

Slide 45 text

You Have Options OT Many options (since 1998) •Wave •Google Docs •Etherpad Post-OT Tombstones Tombstones WOOT 2005 RGA 2011 CT 2010 Treedoc 2007 Logoot 2009 LSEQ 2013 ×

Slide 46

Slide 46 text

References Oster et al (2006) Data Consistency for P2P Collaborative Editing http://www.loria.fr/~oster/pmwiki/pub/papers/OsterCSCW06.pdf Ahmed-Nacer et al (2011) Evaluating CRDTs for Real-time Document Editing http://hal.archives-ouvertes.fr/docs/00/62/95/03/PDF/doce63-ahmednacer.pdf Nédelec, Molli, Mostefaoui & Desmontils (2013)
 LSEQ: an Adaptive Structure for Sequences in Distributed Collaborative Editing http://dl.acm.org/citation.cfm?id=2494278

Slide 47

Slide 47 text

Summary ‣WOOT pretty neat ‣Lift is pretty neat ‣Put effort into the editor
 ‣Fun area, go explore


Slide 48

Slide 48 text

Thank you Richard Dallaway Jono Ferguson @d6y @jonoabroad bitbucket.org/d6y/woot