Slide 1

Slide 1 text

Moving elements in list CRDTs Martin Kleppmann University of Cambridge, UK [email protected]

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

List (sequence, array) CRDTs: WOOT, Treedoc, Logoot, RGA, Causal Trees, LSEQ, …

Slide 12

Slide 12 text

List (sequence, array) CRDTs: WOOT, Treedoc, Logoot, RGA, Causal Trees, LSEQ, … Emulating “move” as “delete-and-reinsert”: concurrent moves of the same item à duplication

Slide 13

Slide 13 text

Concurrent move of the same item to different positions — what should happen?

Slide 14

Slide 14 text

Converge to one of the destination positions (pick one arbitrarily but deterministically)

Slide 15

Slide 15 text

“pick one arbitrarily” = last-writer wins register! posphone joe := “head of the list” merge posphone joe == “head of the list” posphone joe := “after buy milk”

Slide 16

Slide 16 text

List CRDT with move operation posphone joe := “after buy milk” need one register per list item state = AWSet({ (v1 , LWWRegister(p1 )), (v2 , LWWRegister(p2 )), … }) need a stable way of referencing list positions Treedoc: path through binary tree Logoot: list of (integer, replicaID) pairs RGA: s4vector Causal Trees: logical timestamp etc… Composition of any list CRDT + AWSet + LWWRegister = another CRDT

Slide 17

Slide 17 text

Moving ranges of elements

Slide 18

Slide 18 text

Moving ranges of elements

Slide 19

Slide 19 text

Desired outcome

Slide 20

Slide 20 text

Actual outcome Fixing this: an open problem!

Slide 21

Slide 21 text

Thanks! Martin Kleppmann University of Cambridge, UK [email protected]