Eventually
Consistent Computations
Christopher S. Meiklejohn
Peter Van Roy
Slide 2
Slide 2 text
large-scale computation
without synchronization
Slide 3
Slide 3 text
large-scale computation
without synchronization
Slide 4
Slide 4 text
large-scale computation
without synchronization
Slide 5
Slide 5 text
large-scale computation
without synchronization
Slide 6
Slide 6 text
the Plan
Slide 7
Slide 7 text
conflict-free
replicated data types
(CRDTs)
Slide 8
Slide 8 text
distributed
deterministic dataflow
Slide 9
Slide 9 text
compose CRDTs using
deterministic data flow
Slide 10
Slide 10 text
the Data Types
Slide 11
Slide 11 text
state-based
conflict-free replicated
data types
Slide 12
Slide 12 text
state-based
conflict-free replicated
data types
Slide 13
Slide 13 text
semantic resolution
Slide 14
Slide 14 text
semantic resolution
“In all such systems, we find developers spend a significant fraction of their
time building extremely complex and error-prone mechanisms to cope with
eventual consistency and handle data that may be out of date.”
“F1: A Distributed SQL Database That Scales” (VLDB 2013)
Slide 15
Slide 15 text
strong eventual consistency
Slide 16
Slide 16 text
strong eventual consistency
“Systems in which replica conflicts are impossible by design exhibit
Strong Eventual Consistency (SEC).”
- Wikipedia, ”Eventual Consistency”
Slide 17
Slide 17 text
state-based
conflict-free replicated
data types
Slide 18
Slide 18 text
bounded Join-Semilattices*
* drastically simplified example
the Distribution Model
4
6
5
the
Application
1
3
2
read(X)
bind(Y, 2)
read(Y)
bind(X, 1)
Slide 30
Slide 30 text
the Distribution Model
Slide 31
Slide 31 text
1
3
2
the
Application
the Distribution Model
bind(X, 1)
1
2
3
ok
Slide 32
Slide 32 text
1
3
2
the
Application
the Distribution Model
Slide 33
Slide 33 text
1
3
2
the
Application
the Distribution Model
register(application)
1
2
3 ok
A’
A’
Slide 34
Slide 34 text
1
3
2
the
Application
the Distribution Model
Slide 35
Slide 35 text
1
3
2
the
Application
the Distribution Model
execute(application)
1
2
3 {ok, Result}
A’
A’
⊔
Slide 36
Slide 36 text
the Distribution Model
1
3
2
4
6
5
the
Application
Slide 37
Slide 37 text
the Distribution Model
1
3
2
4
6
5
the
Application
1 4
⊕
2 5
Slide 38
Slide 38 text
the Distribution Model
1
3
2
4
6
5
the
Application
2 5
Slide 39
Slide 39 text
the Distribution Model
1
3
2
4
6
5
the
Application
1 4
⊕
2 5
5
2
⊔
⊔
Slide 40
Slide 40 text
the Examples
Slide 41
Slide 41 text
C1 C2 C3
S1 S2
M1 M2 M3
the Ad Counter
the Diagram
Slide 42
Slide 42 text
C1 C2 C3
S1 S2
M1 M2 M3
view
inc
rem
view view
the Ad Counter
the Diagram
Slide 43
Slide 43 text
the Secondary Index
the Program
Slide 44
Slide 44 text
the Secondary Index
the Program
filter(fun even/1)*
(* computes -CRDT)
[1, 2]
[2, 6]
[1, 2, 5]
[2]
[2, 6]
[2, 6]
Slide 45
Slide 45 text
the Secondary Index
the Diagram
Slide 46
Slide 46 text
⊕
the Secondary Index
the Diagram
3
1
2
⊔
Slide 47
Slide 47 text
the Conclusion
Slide 48
Slide 48 text
sequential composability
Slide 49
Slide 49 text
divergence control
Slide 50
Slide 50 text
moving computation
to the client
Slide 51
Slide 51 text
thanks
peter Van Roy russell Brown marc Shapiro
annette Bieniusa manuel Bravo jordan West
sean Cribbs carlos Baquero nuno Preguica joao
Leitao ryan Zezeski tom Santero peter Alvaro
image credits: Wikipedia, “The Village (The Prisoner)”
slides: https://speakerdeck.com/cmeiklejohn/eventually-consistent-computations
prototype: https://github.com/cmeiklejohn/derflow