Slide 1

Slide 1 text

SyncFree (FP7) Large-scale computation without synchronization Christopher Meiklejohn Erlang Workshop 2015, ICFP

Slide 2

Slide 2 text

Background

Slide 3

Slide 3 text

• Resolving concurrent modifications
 Identify and resolve concurrent operations on replicated data • Geo-replication
 More concurrency; coordination even less viable • Semantic resolution
 Resolution by “user”; not intuitive
 Dynamo (SOSP ‘07)

Slide 4

Slide 4 text

CRDTs

Slide 5

Slide 5 text

• “Conflict-Free” Replicated Data Types
 Deterministic resolution under concurrent operations • Types
 Counters, Sets, Maps, Flags, Registers, Graphs • Implementations
 Riak DT (Riak KV, Antidote, Lasp, Plumtree)
 SwiftCloud

Slide 6

Slide 6 text

• SyncFree (FP7)
 Large scale, synchronization free, computation. • Academic Partners
 Inria, Koç Üniversitesi, Universidade Nova de Lisboa, TU Kaiserslautern, Université catholique de Louvain • Industry Partners
 Basho Technologies, Trifork, Rovio Entertainment, Erlang Solutions

Slide 7

Slide 7 text

Example

Slide 8

Slide 8 text

RA RB RC

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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})

Slide 13

Slide 13 text

Challenges

Slide 14

Slide 14 text

Atomicity • Goal
 How can we guarantee changes to independent objects appear atomically? • Composition (Brown et al., PaPEC ’14)
 Riak DT’s composable map: arbitrary* composition of data types • Transactions (Antidote, SwiftCloud Middleware ’15)
 Weak transactions providing causal consistency

Slide 15

Slide 15 text

Invariant Preservation • Goal
 How can we enforce global system invariants? • Explicit Consistency (Balegas et al., EuroSys ’15)
 Application-specific invariants maintained through violation-avoidance or invariant-repair • RPB (Najafzadeh et al., DCC ’13)
 Extension to red/blue consistency for transactions that can be executed with “reservations”

Slide 16

Slide 16 text

Computation • Goal
 How can we write computations with CRDTs that result in correct programs? • Lasp (Meiklejohn et al., PPDP ’15)
 Dataflow programming model that uses CRDTs as the primary data abstraction • C-CRDTs (Navalho et al., PaPoC ’15)
 Computational CRDTs that “compute” results as part of their merge functions

Slide 17

Slide 17 text

Optimization • Goal
 How can we reduce the state we need to ship and perform metadata reduction? • PO-Log (Baquero et al., DAIS ’14)
 Partially ordered log of operations disseminated through tagged reliable broadcast • Delta-State CRDTs (Almeida et al., PaPEC ’14)
 State reduction techniques for using state-based CRDTs

Slide 18

Slide 18 text

Verification • Goal
 How can we verify the correctness of CRDTs? • Specification of CRDTs (Zeller et al., IFIP ’14)
 Isabelle/HOL specification of CRDTs from the original Inria report • Specification of applications
 Specifications of industry use cases using TLA+

Slide 19

Slide 19 text

Evaluation • Goal
 How can we evaluate this at scale? • Use case selection
 Identify industrial partners that can provide realistic use cases (virtual wallet, advertisement counter) • Evaluate at scale
 Using reproducible workloads, run experiments at scale with customers who have deployed Basho’s Riak

Slide 20

Slide 20 text

Experience

Slide 21

Slide 21 text

Erlang • Why Erlang?
 Existing deployments of databases in Erlang through Basho’s customer base using Riak • Goal of modularity
 Plug in different modules, share code between Riak and Antidote • In practice, this doesn’t work
 Riak is very complicated, with lots of performance optimizations

Slide 22

Slide 22 text

Antidote Experience • Great for prototyping
 Distributed Erlang is a huge benefit to prototyping distributed applications • Hard to find experienced developers
 Difficult to find developers with either Erlang or FP experience • Difficulty with cross platform deployment
 Unable to repurpose code for testing in other settings

Slide 23

Slide 23 text

Lasp Experience • Similar to Antidote
 Same experience with Distributed Erlang and cross platform deployment • Types and Typeclasses
 Implementation would be cleaner; lots of manual type checking by carrying around both type and value.

Slide 24

Slide 24 text

Questions?