29
consistency without borders eter Alvaro, Peter Bailis, eil Conway, Joseph M. Hellerstein C Berkeley

c onsistency without borders

  • Upload
    isaiah

  • View
    30

  • Download
    0

Embed Size (px)

DESCRIPTION

c onsistency without borders. Peter Alvaro , Peter Bailis , Neil Conway, Joseph M. Hellerstein UC Berkeley. The transaction concept. DEBIT_CREDIT: BEGIN_TRANSACTION; GET MESSAGE; EXTRACT ACCOUT_NUMBER, DELTA, TELLER, BRANCH - PowerPoint PPT Presentation

Citation preview

Page 1: c onsistency without borders

consistency without borders

Peter Alvaro, Peter Bailis, Neil Conway, Joseph M. HellersteinUC Berkeley

Page 2: c onsistency without borders

The transaction concept DEBIT_CREDIT: BEGIN_TRANSACTION; GET MESSAGE; EXTRACT ACCOUT_NUMBER, DELTA, TELLER, BRANCH FROM MESSAGE; FIND ACCOUNT(ACCOUT_NUMBER) IN DATA BASE; IF NOT_FOUND | ACCOUNT_BALANCE + DELTA < 0 THEN PUT NEGATIVE RESPONSE; ELSE DO; ACCOUNT_BALANCE = ACCOUNT_BALANCE + DELTA; POST HISTORY RECORD ON ACCOUNT (DELTA); CASH_DRAWER(TELLER) = CASH_DRAWER(TELLER) + DELTA; BRANCH_BALANCE(BRANCH) = BRANCH_BALANCE(BRANCH) + DELTA; PUT MESSAGE ('NEW BALANCE =' ACCOUNT_BALANCE); END; COMMIT;

Page 3: c onsistency without borders

An application-level contract

Write Read

Application

Opaquestore

Transactions

Page 4: c onsistency without borders

Pervasive distribution

CAP

partial failure

asynchrony

Page 5: c onsistency without borders

Research on consistency

Write Read

Application

Opaquestore

Consistency models

Assert: balance > 0

causal?PRAM?delta?fork/join?red/blue?release?SC?

(translation)

R1(X=1) R2(X=1) W1(X=2) W2(X=0)W1(X=1) W1(Y=2) R2(Y=2) R2(X=0)

Page 6: c onsistency without borders

Meanwhile, in industry…

Application

Opaquestore

Custom solutionsAssert: balance > 0

(prayer)

Write Read

Page 7: c onsistency without borders

Distributed consistency: staying relevant

• Is this an important problem?• Is academia disconnected from

reality?• OK, what now?

Goal: help programmers write correct applications.Today: some promising approaches

Page 8: c onsistency without borders

Case study: a graph

Page 9: c onsistency without borders

Partitioned, for scalability

Page 10: c onsistency without borders

Replicated, for availability

Page 11: c onsistency without borders

Problem: deadlock detection

Task: Identify strongly-connected components

Waits-for graph

Page 12: c onsistency without borders

Problem: garbage collection

Task: Identify nodes not reachable from Root.

Root

Refers-to graph

Page 13: c onsistency without borders

Correctness

Deadlock detection• Safety: No false positives-• Liveness: Identify all deadlocksGarbage collection• Safety: Never GC live memory!• Liveness: GC all orphaned memory

Partition

Root

Page 14: c onsistency without borders

Consistency at the extremes

Linearizable key-value store?

Custom solutions?

Efficient Correct

Page 15: c onsistency without borders

Consistency across the stack

Page 16: c onsistency without borders

Object-level consistencyCapture semantics of data structures that• allow greater concurrency • maintain guarantees (e.g. convergence)

Page 17: c onsistency without borders

Insert Read

Convergentdata structure(e.g., Set CRDT)

Object-level consistency

Insert Read

CommutativityAssociativityIdempotence

ReorderingBatchingRetry/duplication

Tolerant to

Page 18: c onsistency without borders

Application

Convergentdata structures

Object-level consistency

? ?

GC Assert: No live nodes are reclaimed

Assert: Graph replicasconverge

Page 19: c onsistency without borders

Flow-level consistency

Page 20: c onsistency without borders

Flow-level consistencyCapture semantics of data in motion• Asynchronous dataflow model• component properties system-wide guarantees

Page 21: c onsistency without borders

Flow-level consistencyOrder-insensitivity (confluence)

output set = f(input set)

{ }

{ }=

Page 22: c onsistency without borders

Flow-level consistencyConfluence is compositional

output set = f g(input set)

Page 23: c onsistency without borders

Graph queries as dataflowConfluent

Coordinate here

Page 24: c onsistency without borders

Language-level consistencyDSLs for distributed programming?• Capture consistency concerns in the

type system

Page 25: c onsistency without borders

Language-level consistency

CALM Theorem:

Monotonic confluent

Conservative, syntactic test for confluence

Page 26: c onsistency without borders

Language-level consistencyDeadlock detector

Garbage collector

nonmonotonic

Page 27: c onsistency without borders

correctreusable

efficientintuitive

Where we’ve been;where we’re headed

Page 28: c onsistency without borders

Remember• Consistency is an application-level

property

• Correctness and performance are compatible

• Meet programmers on their home turf

• Build bridges!

Page 29: c onsistency without borders

Queries?