$30 off During Our Annual Pro Sale. View Details »

Distributed, Eventually Consistent Computations

Distributed, Eventually Consistent Computations

Strange Loop 2015

Christopher Meiklejohn

September 26, 2015
Tweet

More Decks by Christopher Meiklejohn

Other Decks in Research

Transcript

  1. Distributed
    Eventually Consistent
    Computations
    Christopher Meiklejohn // @cmeik
    Strange Loop 2015, September 24 - 26th, 2015
    1

    View Slide

  2. RA
    RB

    View Slide

  3. RA
    RB
    1
    set(1)

    View Slide

  4. RA
    RB
    1
    set(1)
    3
    2
    set(2)
    set(3)

    View Slide

  5. RA
    RB
    1
    set(1)
    3
    2
    set(2)
    set(3)
    ?
    ?

    View Slide

  6. Synchronization
    • To enforce an order

    Makes programming easier
    6

    View Slide

  7. Synchronization
    • To enforce an order

    Makes programming easier
    • Eliminate accidental nondeterminism

    Prevent race conditions
    6

    View Slide

  8. Synchronization
    • To enforce an order

    Makes programming easier
    • Eliminate accidental nondeterminism

    Prevent race conditions
    • Techniques

    Locks, mutexes, semaphores, monitors, etc.
    6

    View Slide

  9. Difficult Cases
    • “Internet of Things”

    Low power, limited memory and connectivity
    7

    View Slide

  10. Difficult Cases
    • “Internet of Things”

    Low power, limited memory and connectivity
    • Mobile Gaming

    Offline operation with replicated, shared state
    7

    View Slide

  11. Zero Synchronization
    • We want to have our cake and eat it too.
    8

    View Slide

  12. Zero Synchronization
    • We want to have our cake and eat it too.
    • “Zero synchronization” as a starting point

    Add synchronization only where it is necessary
    8

    View Slide

  13. Zero Synchronization
    • We want to have our cake and eat it too.
    • “Zero synchronization” as a starting point

    Add synchronization only where it is necessary
    • Explore the limits

    Can we design a model of computation where it’s
    easy to write coordination-free computations that
    are free from concurrency anomalies?
    8

    View Slide

  14. 9
    Strong
    Weak
    Strong
    (Data Center)
    Weak
    (Open Internet)
    Sharing

    (Application Property)
    Coupling (Infrastructure Property)

    View Slide

  15. 9
    Strong
    Weak
    Strong
    (Data Center)
    Weak
    (Open Internet)
    Sharing

    (Application Property)
    Coupling (Infrastructure Property)
    MapReduce SETI@Home

    View Slide

  16. 9
    Strong
    Weak
    Strong
    (Data Center)
    Weak
    (Open Internet)
    Sharing

    (Application Property)
    Coupling (Infrastructure Property)
    Twitter
    MapReduce SETI@Home

    View Slide

  17. 9
    Strong
    Weak
    Strong
    (Data Center)
    Weak
    (Open Internet)
    Sharing

    (Application Property)
    Coupling (Infrastructure Property)
    Twitter
    MapReduce SETI@Home
    Synchronization-Free
    Computations

    View Slide

  18. The Fundamentals of
    Distributed Computation
    10

    View Slide

  19. Distributed Computation
    • Distributed to concurrent programming

    Consistency and now partial failure
    11

    View Slide

  20. Distributed Computation
    • Distributed to concurrent programming

    Consistency and now partial failure
    • Enforcing the “single system” illusion
    11

    View Slide

  21. Distributed Computation
    • Distributed to concurrent programming

    Consistency and now partial failure
    • Enforcing the “single system” illusion
    • Consistency model as a contract
    11

    View Slide

  22. Distributed Computation
    • Distributed to concurrent programming

    Consistency and now partial failure
    • Enforcing the “single system” illusion
    • Consistency model as a contract
    • Enforced through synchronization
    11

    View Slide

  23. Distributed Computation
    • Distributed to concurrent programming

    Consistency and now partial failure
    • Enforcing the “single system” illusion
    • Consistency model as a contract
    • Enforced through synchronization
    • Consistency model

    We can think of a consistency model as analogous
    to a programming paradigm
    11

    View Slide

  24. Why Is Synchronization
    Undesirable?
    12

    View Slide

  25. The Avatars of Time
    • The problem of time

    Handling physical time in applications is difficult
    13

    View Slide

  26. The Avatars of Time
    • The problem of time

    Handling physical time in applications is difficult
    • Time has three major avatars in computing
    13

    View Slide

  27. The Avatars of Time
    • The problem of time

    Handling physical time in applications is difficult
    • Time has three major avatars in computing
    • Mutable state in sequential systems
    13

    View Slide

  28. The Avatars of Time
    • The problem of time

    Handling physical time in applications is difficult
    • Time has three major avatars in computing
    • Mutable state in sequential systems
    • Nondeterminism in concurrent systems
    13

    View Slide

  29. The Avatars of Time
    • The problem of time

    Handling physical time in applications is difficult
    • Time has three major avatars in computing
    • Mutable state in sequential systems
    • Nondeterminism in concurrent systems
    ★ Network latency in distributed systems
    13

    View Slide

  30. The Avatars of Time
    • The problem of time

    Handling physical time in applications is difficult
    • Time has three major avatars in computing
    • Mutable state in sequential systems
    • Nondeterminism in concurrent systems
    ★ Network latency in distributed systems
    • Unavoidable

    Time is how users interact with programs
    13

    View Slide

  31. Parable of the Car
    • “Car driving on a highway”
    14

    View Slide

  32. Parable of the Car
    • “Car driving on a highway”
    • Friction needed for the car to grip the road
    14

    View Slide

  33. Parable of the Car
    • “Car driving on a highway”
    • Friction needed for the car to grip the road
    • Motors want as little friction as possible
    14

    View Slide

  34. Parable of the Car
    • “Car driving on a highway”
    • Friction needed for the car to grip the road
    • Motors want as little friction as possible
    • Time is like friction

    We can not completely eliminate friction, but aim to
    reduce it as much as possible
    14

    View Slide

  35. Physical
    Time
    (real world)
    Parable of the Car
    15
    • Time only at the interface

    The interface is a small part of the system, and this is where we
    introduction friction

    View Slide

  36. Physical
    Time
    (real world)
    Parable of the Car
    15
    • Time only at the interface

    The interface is a small part of the system, and this is where we
    introduction friction
    • Physical time-free execution

    Internally, avoid synchronization as much as possible and virtualize
    notion of time

    View Slide

  37. No Time In The Box?
    16

    View Slide

  38. No Time In The Box?
    16
    You program the box.

    View Slide

  39. Weak Synchronization
    • Can we achieve anything without synchronization?

    Not really.
    17

    View Slide

  40. Weak Synchronization
    • Can we achieve anything without synchronization?

    Not really.
    • Strong Eventual Consistency (SEC)

    “Replicas that deliver the same updates have equivalent state”
    17

    View Slide

  41. Weak Synchronization
    • Can we achieve anything without synchronization?

    Not really.
    • Strong Eventual Consistency (SEC)

    “Replicas that deliver the same updates have equivalent state”
    • Primary requirement

    Eventual replica-to-replica communication
    17

    View Slide

  42. Weak Synchronization
    • Can we achieve anything without synchronization?

    Not really.
    • Strong Eventual Consistency (SEC)

    “Replicas that deliver the same updates have equivalent state”
    • Primary requirement

    Eventual replica-to-replica communication
    • Order insensitive! (Commutativity)
    17

    View Slide

  43. Weak Synchronization
    • Can we achieve anything without synchronization?

    Not really.
    • Strong Eventual Consistency (SEC)

    “Replicas that deliver the same updates have equivalent state”
    • Primary requirement

    Eventual replica-to-replica communication
    • Order insensitive! (Commutativity)
    • Duplicate insensitive! (Idempotent)
    17

    View Slide

  44. RA
    RB

    View Slide

  45. RA
    RB
    1
    set(1)

    View Slide

  46. RA
    RB
    1
    set(1)
    3
    2
    set(2)
    set(3)

    View Slide

  47. RA
    RB
    1
    3
    2
    3
    3
    set(1) set(2)
    set(3)
    max(2,3)
    max(2,3)

    View Slide

  48. How can we succeed with
    Strong Eventual Consistency?
    22

    View Slide

  49. Programming SEC
    1. Eliminate accidental nondeterminism

    (ex. deterministic, modeling non-monotonic operations monotonically)
    23

    View Slide

  50. Programming SEC
    1. Eliminate accidental nondeterminism

    (ex. deterministic, modeling non-monotonic operations monotonically)
    2. Retain the properties of functional programming

    (ex. confluence, referential transparency over composition)
    23

    View Slide

  51. Programming SEC
    1. Eliminate accidental nondeterminism

    (ex. deterministic, modeling non-monotonic operations monotonically)
    2. Retain the properties of functional programming

    (ex. confluence, referential transparency over composition)
    3. Distributed, and fault-tolerant runtime

    (ex. replication)
    23

    View Slide

  52. Programming SEC
    1. Eliminate accidental nondeterminism

    (ex. deterministic, modeling non-monotonic operations monotonically)

    2. Retain the properties of functional programming

    (ex. confluence, referential transparency over composition)
    3. Distributed, and fault-tolerant runtime

    (ex. replication)
    24

    View Slide

  53. Convergent Objects

    Conflict-Free 

    Replicated Data Types
    25
    SSS 2011

    View Slide

  54. Conflict-Free 

    Replicated Data Types
    • Many types exist with different properties

    Sets, counters, registers, flags, maps, graphs
    26

    View Slide

  55. Conflict-Free 

    Replicated Data Types
    • Many types exist with different properties

    Sets, counters, registers, flags, maps, graphs
    • Strong Eventual Consistency

    Instances satisfy SEC property per-object
    26

    View Slide

  56. RA
    RB
    RC

    View Slide

  57. RA
    RB
    RC
    {1}
    (1, {a}, {})
    add(1)

    View Slide

  58. RA
    RB
    RC
    {1}
    (1, {a}, {})
    add(1)
    {1}
    (1, {b}, {})
    add(1)

    View Slide

  59. RA
    RB
    RC
    {1}
    (1, {a}, {})
    add(1)
    {1}
    (1, {b}, {})
    add(1)
    {}
    (1, {b}, {b})
    remove(1)

    View Slide

  60. RA
    RB
    RC
    {1}
    (1, {a}, {})
    add(1)
    {1}
    (1, {b}, {})
    add(1)
    {}
    (1, {b}, {b})
    remove(1)
    {1}
    {1}
    {1}
    (1, {a, b}, {b})
    (1, {a, b}, {b})
    (1, {a, b}, {b})

    View Slide

  61. Programming SEC
    1. Eliminate accidental nondeterminism

    (ex. deterministic, modeling non-monotonic operations monotonically)

    2. Retain the properties of functional programming

    (ex. confluence, referential transparency over composition)
    3. Distributed, and fault-tolerant runtime

    (ex. replication)
    32

    View Slide

  62. Convergent Programs
    Lattice Processing
    33
    PPDP 2015

    View Slide

  63. Lattice Processing (Lasp)
    • Distributed, deterministic dataflow

    Distributed, deterministic dataflow programming
    model for “eventually consistent” computations
    34

    View Slide

  64. Lattice Processing (Lasp)
    • Distributed, deterministic dataflow

    Distributed, deterministic dataflow programming
    model for “eventually consistent” computations
    • Convergent data structures

    Primary data abstraction is the CRDT
    34

    View Slide

  65. Lattice Processing (Lasp)
    • Distributed, deterministic dataflow

    Distributed, deterministic dataflow programming
    model for “eventually consistent” computations
    • Convergent data structures

    Primary data abstraction is the CRDT
    • Enables composition

    Provides functional composition of CRDTs that
    preserves the SEC property
    34

    View Slide

  66. 35
    %% Create initial set.
    S1 = declare(set),
    %% Add elements to initial set and update.
    update(S1, {add, [1,2,3]}),
    %% Create second set.
    S2 = declare(set),
    %% Apply map operation between S1 and S2.
    map(S1, fun(X) -> X * 2 end, S2).

    View Slide

  67. 36
    %% Create initial set.
    S1 = declare(set),
    %% Add elements to initial set and update.
    update(S1, {add, [1,2,3]}),
    %% Create second set.
    S2 = declare(set),
    %% Apply map operation between S1 and S2.
    map(S1, fun(X) -> X * 2 end, S2).

    View Slide

  68. 37
    %% Create initial set.
    S1 = declare(set),
    %% Add elements to initial set and update.
    update(S1, {add, [1,2,3]}),
    %% Create second set.
    S2 = declare(set),
    %% Apply map operation between S1 and S2.
    map(S1, fun(X) -> X * 2 end, S2).

    View Slide

  69. 38
    %% Create initial set.
    S1 = declare(set),
    %% Add elements to initial set and update.
    update(S1, {add, [1,2,3]}),
    %% Create second set.
    S2 = declare(set),
    %% Apply map operation between S1 and S2.
    map(S1, fun(X) -> X * 2 end, S2).

    View Slide

  70. 39
    %% Create initial set.
    S1 = declare(set),
    %% Add elements to initial set and update.
    update(S1, {add, [1,2,3]}),
    %% Create second set.
    S2 = declare(set),
    %% Apply map operation between S1 and S2.
    map(S1, fun(X) -> X * 2 end, S2).

    View Slide

  71. Lattice Processing (Lasp)
    • Functional and set-theoretic operations on sets

    Product, intersection, union, filter, map, fold
    40

    View Slide

  72. Lattice Processing (Lasp)
    • Functional and set-theoretic operations on sets

    Product, intersection, union, filter, map, fold
    • Metadata computation

    Performs transformation on the internal metadata of
    CRDTs allowing creation of “composed” CRDTs
    40

    View Slide

  73. Lasp Processes
    • Replicas as monotonic streams

    Each replica of a CRDT produces a monotonic
    stream of states
    41

    View Slide

  74. Lasp Processes
    • Replicas as monotonic streams

    Each replica of a CRDT produces a monotonic
    stream of states
    • Monotonic processes

    Read from one or more input replica streams and
    produce a single output replica stream
    41

    View Slide

  75. Lasp Processes
    • Replicas as monotonic streams

    Each replica of a CRDT produces a monotonic
    stream of states
    • Monotonic processes

    Read from one or more input replica streams and
    produce a single output replica stream
    • Inflationary reads

    Read operation ensures that we only read
    inflationary updates to replicas
    41

    View Slide

  76. Lattice Processing
    Monotonic Streams
    42

    View Slide

  77. RA
    {}
    C1
    {}
    C2
    {}
    43

    View Slide

  78. RA
    {}
    (1, {a}, {})
    C1
    (1, {a}, {})
    {}
    C2
    {}
    44

    View Slide

  79. RA
    {}
    (1, {a}, {})
    (1, {a, b}, {})
    C1
    (1, {a}, {})
    {}
    C2
    (1, {b}, {})
    {}
    45

    View Slide

  80. RA
    {}
    (1, {a}, {})
    (1, {a, b}, {})
    (1, {a, b}, {a})
    C1
    (1, {a}, {})
    {}
    (1, {a}, {a})
    C2
    (1, {b}, {})
    {}
    46

    View Slide

  81. RA
    {}
    (1, {a}, {})
    (1, {a, b}, {})
    (1, {a, b}, {a})
    C1
    (1, {a}, {})
    {}
    (1, {a}, {a})
    C2
    (1, {b}, {})
    {}
    (1, {a, b}, {a})
    (1, {a, b}, {a}) (1, {a, b}, {a})
    47

    View Slide

  82. RA
    {}
    (1, {a}, {})
    (1, {a, b}, {})
    (1, {a, b}, {a})
    C1
    (1, {a}, {})
    {}
    (1, {a}, {a})
    C2
    (1, {b}, {})
    {}
    (1, {a, b}, {a})
    (1, {a, b}, {a}) (1, {a, b}, {a})
    48

    View Slide

  83. Lattice Processing
    Monotonic Processes
    49

    View Slide

  84. RA
    {}
    P1 F(RA)
    {}
    50

    View Slide

  85. RA
    {}
    P1 F(RA)
    {}
    strict_read({})
    51

    View Slide

  86. RA
    {}
    P1 F(RA)
    {}
    strict_read({})
    (1, {a}, {})
    52

    View Slide

  87. RA
    {}
    P1 F(RA)
    {}
    strict_read({})
    (1, {a}, {}) F((1, {a}, {}))
    53

    View Slide

  88. RA
    {}
    P1 F(RA)
    {}
    strict_read({})
    (1, {a}, {}) F((1, {a}, {})) (2, {a}, {})
    54

    View Slide

  89. RA
    {}
    P1 F(RA)
    {}
    strict_read({})
    (1, {a}, {}) F((1, {a}, {})) (2, {a}, {})
    strict_read((1, {a}, {})
    (1, {a}, {})
    55

    View Slide

  90. RA
    {}
    P1 F(RA)
    {}
    strict_read({})
    (1, {a}, {}) F((1, {a}, {})) (2, {a}, {})
    strict_read((1, {a}, {})
    (1, {a}, {})
    (1, {a}, {a}) F((1, {a}, {a})) (2, {a}, {a})
    strict_read((1, {a}, {a})
    (1, {a}, {a})
    56

    View Slide

  91. RA
    {}
    P1 F(RA)
    {}
    strict_read({})
    (1, {a}, {})
    (1, {a}, {})
    (1, {a}, {a}) F((1, {a}, {a})) (2, {a}, {a})
    strict_read((1, {a}, {a})
    (1, {a}, {a})
    57

    View Slide

  92. Programming SEC
    1. Eliminate accidental nondeterminism

    (ex. deterministic, modeling non-monotonic operations monotonically)

    2. Retain the properties of functional programming

    (ex. confluence, referential transparency over composition)
    3. Distributed, and fault-tolerant runtime

    (ex. replication)
    58

    View Slide

  93. Distributed Runtime
    Selective Hearing
    59
    W-PSDS 2015

    View Slide

  94. Selective Hearing
    • Epidemic broadcast based runtime system

    Provide a runtime system that can scale to large numbers of
    nodes, that is resilient to failures and provides efficient execution
    60

    View Slide

  95. Selective Hearing
    • Epidemic broadcast based runtime system

    Provide a runtime system that can scale to large numbers of
    nodes, that is resilient to failures and provides efficient execution
    • Well-matched to Lattice Processing (Lasp)
    60

    View Slide

  96. Selective Hearing
    • Epidemic broadcast based runtime system

    Provide a runtime system that can scale to large numbers of
    nodes, that is resilient to failures and provides efficient execution
    • Well-matched to Lattice Processing (Lasp)
    • Epidemic broadcast mechanisms provide weak ordering but
    are resilient and efficient
    60

    View Slide

  97. Selective Hearing
    • Epidemic broadcast based runtime system

    Provide a runtime system that can scale to large numbers of
    nodes, that is resilient to failures and provides efficient execution
    • Well-matched to Lattice Processing (Lasp)
    • Epidemic broadcast mechanisms provide weak ordering but
    are resilient and efficient
    • Lasp’s programming model is tolerant to message re-ordering,
    disconnections, and node failures
    60

    View Slide

  98. Selective Hearing
    • Epidemic broadcast based runtime system

    Provide a runtime system that can scale to large numbers of
    nodes, that is resilient to failures and provides efficient execution
    • Well-matched to Lattice Processing (Lasp)
    • Epidemic broadcast mechanisms provide weak ordering but
    are resilient and efficient
    • Lasp’s programming model is tolerant to message re-ordering,
    disconnections, and node failures
    • “Selective Receive”

    Nodes selectively receive and process messages based on
    interest.
    60

    View Slide

  99. Programming SEC
    1. Eliminate accidental nondeterminism

    (ex. deterministic, modeling non-monotonic operations monotonically)

    2. Retain the properties of functional programming

    (ex. confluence, referential transparency over composition)
    3. Distributed, and fault-tolerant runtime

    (ex. replication)
    61

    View Slide

  100. What can we build?
    Advertisement Counter
    62

    View Slide

  101. Advertisement Counter
    • Mobile game platform selling advertisement space

    Advertisements are paid according to a minimum
    number of impressions
    63

    View Slide

  102. Advertisement Counter
    • Mobile game platform selling advertisement space

    Advertisements are paid according to a minimum
    number of impressions
    • Clients will go offline

    Clients have limited connectivity and the system still
    needs to make progress while clients are offline
    63

    View Slide

  103. Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Lasp Operation
    User-Maintained CRDT
    Lasp-Maintained CRDT
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client
    64

    View Slide

  104. Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Riot Ads
    Rovio
    Ads
    Product
    Read
    50,000
    Remove
    Increment
    Union
    65
    Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Lasp Operation
    User-Maintained CRDT
    Lasp-Maintained CRDT
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client

    View Slide

  105. Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Client
    66
    Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Lasp Operation
    User-Maintained CRDT
    Lasp-Maintained CRDT
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client

    View Slide

  106. Ads
    ovio Ad
    ounter 1
    ovio Ad
    ounter 2
    iot Ad
    ounter 1
    iot Ad
    ounter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Rovio Ad
    Counter
    1
    Ro
    C
    Rovio Ad
    Counter
    1
    Ro
    C
    Rovio Ad
    Counter
    1
    Ro
    C
    Rovio Ad
    Counter
    1
    Ro
    C
    Client Side, Sing
    67
    Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Lasp Operation
    User-Maintained CRDT
    Lasp-Maintained CRDT
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client

    View Slide

  107. Ads
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    move Read
    Union
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client
    68
    Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Lasp Operation
    User-Maintained CRDT
    Lasp-Maintained CRDT
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client

    View Slide

  108. Ads
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Filter
    Product
    Read
    Union
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client
    69
    Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Lasp Operation
    User-Maintained CRDT
    Lasp-Maintained CRDT
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client

    View Slide

  109. Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client
    70
    Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Lasp Operation
    User-Maintained CRDT
    Lasp-Maintained CRDT
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client

    View Slide

  110. Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Riot Ads
    Rovio
    Ads
    Fil
    Product
    Read
    50,000
    Remove
    Increment
    Union
    71
    Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Lasp Operation
    User-Maintained CRDT
    Lasp-Maintained CRDT
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client

    View Slide

  111. Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client
    72
    Ads
    Rovio Ad
    Counter 1
    Rovio Ad
    Counter 2
    Riot Ad
    Counter 1
    Riot Ad
    Counter 2
    Contracts
    Ads
    Contracts
    Ads
    With
    Contracts
    Riot Ads
    Rovio
    Ads
    Filter
    Product
    Read
    50,000
    Remove
    Increment
    Read
    Union
    Lasp Operation
    User-Maintained CRDT
    Lasp-Maintained CRDT
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Rovio Ad
    Counter
    1
    Rovio Ad
    Counter
    2
    Riot Ad
    Counter
    1
    Client Side, Single Copy at Client

    View Slide

  112. Advertisement Counter
    • Completely monotonic

    Disabling advertisements and contracts are all
    modeled through monotonic state growth
    73

    View Slide

  113. Advertisement Counter
    • Completely monotonic

    Disabling advertisements and contracts are all
    modeled through monotonic state growth
    • Arbitrary distribution

    Use of convergent data structures allows
    computational graph to be arbitrarily distributed
    73

    View Slide

  114. Advertisement Counter
    • Completely monotonic

    Disabling advertisements and contracts are all
    modeled through monotonic state growth
    • Arbitrary distribution

    Use of convergent data structures allows
    computational graph to be arbitrarily distributed
    • Divergence

    Divergence is a factor of synchronization period
    73

    View Slide

  115. We’ve build up from zero
    synchronization
    74

    View Slide

  116. We’ve build up from zero
    synchronization
    74
    Instead of working to
    remove synchronization

    View Slide

  117. What’s next?
    75

    View Slide

  118. What’s Next?
    • Reduce metadata

    Metadata can grow very large
    76

    View Slide

  119. What’s Next?
    • Reduce metadata

    Metadata can grow very large
    • Provide a more general ‘fold’ operation

    Currently very restrictive, how general can it be?
    76

    View Slide

  120. What’s Next?
    • Reduce metadata

    Metadata can grow very large
    • Provide a more general ‘fold’ operation

    Currently very restrictive, how general can it be?
    • Auto-placement

    What can the dataflow graph tell us about
    placement?
    76

    View Slide

  121. What have we learned?
    77

    View Slide

  122. Programming SEC
    1. Eliminate accidental nondeterminism

    Convergent Objects: Conflict-Free Replicated Data Types
    78

    View Slide

  123. Programming SEC
    1. Eliminate accidental nondeterminism

    Convergent Objects: Conflict-Free Replicated Data Types
    2. Retain the properties of functional programming

    Convergent Programs: Lattice Processing
    78

    View Slide

  124. Programming SEC
    1. Eliminate accidental nondeterminism

    Convergent Objects: Conflict-Free Replicated Data Types
    2. Retain the properties of functional programming

    Convergent Programs: Lattice Processing
    3. Distributed, and fault-tolerant runtime

    Distributed Runtime: Selective Hearing
    78

    View Slide

  125. Key Points
    • Synchronization is expensive

    Locking and other synchronization mechanisms limit
    scalability to the critical section
    79

    View Slide

  126. Key Points
    • Synchronization is expensive

    Locking and other synchronization mechanisms limit
    scalability to the critical section
    • Synchronization is sometimes not possible

    Mobile and “Internet of Things” applications make
    synchronization for replicated state impractical
    79

    View Slide

  127. Key Points
    • Synchronization is expensive

    Locking and other synchronization mechanisms limit
    scalability to the critical section
    • Synchronization is sometimes not possible

    Mobile and “Internet of Things” applications make
    synchronization for replicated state impractical
    • Apply synchronization only where required

    Global invariants, atomic visibility, etc.
    79

    View Slide

  128. How do I learn more?
    80

    View Slide

  129. Publications
    • “Lasp: A Language for Distributed, Coordination-Free Programming” 

    ACM SIGPLAN PPDP 2015
    81

    View Slide

  130. Publications
    • “Lasp: A Language for Distributed, Coordination-Free Programming” 

    ACM SIGPLAN PPDP 2015
    • “Selective Hearing: An Approach to Distributed, Eventually Consistent Edge
    Computation”

    IEEE W-PSDS 2015
    81

    View Slide

  131. Publications
    • “Lasp: A Language for Distributed, Coordination-Free Programming” 

    ACM SIGPLAN PPDP 2015
    • “Selective Hearing: An Approach to Distributed, Eventually Consistent Edge
    Computation”

    IEEE W-PSDS 2015
    • “The Implementation and Use of a Generic Dataflow Behaviour in Erlang”

    ACM SIGPLAN Erlang Workshop ’15
    81

    View Slide

  132. Publications
    • “Lasp: A Language for Distributed, Coordination-Free Programming” 

    ACM SIGPLAN PPDP 2015
    • “Selective Hearing: An Approach to Distributed, Eventually Consistent Edge
    Computation”

    IEEE W-PSDS 2015
    • “The Implementation and Use of a Generic Dataflow Behaviour in Erlang”

    ACM SIGPLAN Erlang Workshop ’15
    • “Lasp: A Language for Distributed, Eventually Consistent Computations with
    CRDTs"

    PaPoC 2015
    81

    View Slide

  133. 82
    Lasp Release 0.0.1
    http://lasp-lang.org

    View Slide

  134. SyncFree is a European research project taking place
    for 3 years, staring October 2013, and is funded by
    the European Union, grant agreement n° 609551.
    83

    View Slide

  135. Thanks!
    84
    Christopher Meiklejohn
    @cmeik

    View Slide