c onsistency without borders
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 PresentationTRANSCRIPT
![Page 1: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/1.jpg)
consistency without borders
Peter Alvaro, Peter Bailis, Neil Conway, Joseph M. HellersteinUC Berkeley
![Page 2: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/2.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/3.jpg)
An application-level contract
Write Read
Application
Opaquestore
Transactions
![Page 4: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/4.jpg)
Pervasive distribution
CAP
partial failure
asynchrony
![Page 5: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/5.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/6.jpg)
Meanwhile, in industry…
Application
Opaquestore
Custom solutionsAssert: balance > 0
(prayer)
Write Read
![Page 7: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/7.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/8.jpg)
Case study: a graph
![Page 9: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/9.jpg)
Partitioned, for scalability
![Page 10: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/10.jpg)
Replicated, for availability
![Page 11: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/11.jpg)
Problem: deadlock detection
Task: Identify strongly-connected components
Waits-for graph
![Page 12: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/12.jpg)
Problem: garbage collection
Task: Identify nodes not reachable from Root.
Root
Refers-to graph
![Page 13: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/13.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/14.jpg)
Consistency at the extremes
Linearizable key-value store?
Custom solutions?
Efficient Correct
![Page 15: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/15.jpg)
Consistency across the stack
![Page 16: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/16.jpg)
Object-level consistencyCapture semantics of data structures that• allow greater concurrency • maintain guarantees (e.g. convergence)
![Page 17: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/17.jpg)
Insert Read
Convergentdata structure(e.g., Set CRDT)
Object-level consistency
Insert Read
CommutativityAssociativityIdempotence
ReorderingBatchingRetry/duplication
Tolerant to
![Page 18: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/18.jpg)
Application
Convergentdata structures
Object-level consistency
? ?
GC Assert: No live nodes are reclaimed
Assert: Graph replicasconverge
![Page 19: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/19.jpg)
Flow-level consistency
![Page 20: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/20.jpg)
Flow-level consistencyCapture semantics of data in motion• Asynchronous dataflow model• component properties system-wide guarantees
![Page 21: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/21.jpg)
Flow-level consistencyOrder-insensitivity (confluence)
output set = f(input set)
{ }
{ }=
![Page 22: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/22.jpg)
Flow-level consistencyConfluence is compositional
output set = f g(input set)
![Page 23: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/23.jpg)
Graph queries as dataflowConfluent
Coordinate here
![Page 24: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/24.jpg)
Language-level consistencyDSLs for distributed programming?• Capture consistency concerns in the
type system
![Page 25: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/25.jpg)
Language-level consistency
CALM Theorem:
Monotonic confluent
Conservative, syntactic test for confluence
![Page 26: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/26.jpg)
Language-level consistencyDeadlock detector
Garbage collector
nonmonotonic
![Page 27: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/27.jpg)
correctreusable
efficientintuitive
Where we’ve been;where we’re headed
![Page 28: c onsistency without borders](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/28.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022070423/56816777550346895ddc722a/html5/thumbnails/29.jpg)
Queries?