SlideShare a Scribd company logo
1 of 62
Download to read offline
Is there anybody out there?
Scalar Conference Warsaw 2018
Manuel Bernhardt
Disclaimer
[A career in distributed systems] is both exhilara6ng and
frustra6ng. When things work, it's like a symphony. When they
don't, it's like an eleventh-birthday party where half of the kids are
on speed.
— Jeff Darcy, HekaFS (formerly CloudFS) project lead
@elmanu - h+ps://manuel.bernhardt.io
manuel.bernhardt.io
• Guiding companies that want to get
started with reac4ve systems
• Lightbend consul4ng and training
partner (Akka Cluster, Akka Streams)
• Scuba-diver, currently stranded in
Austria
Mo#va#onal quote
Life is a single player game. You’re born alone. You’re going to die
alone. All of your interpreta8ons are alone. All your memories are
alone. You’re gone in three genera8ons and no one cares. Before
you showed up nobody cared. It’s all single player.
— Naval Ravikant
@elmanu - h+ps://manuel.bernhardt.io
Key issues for building clusters
• discovery: who's there?
• fault detec0on: who's in trouble?
• load balancing: who can take up work?
@elmanu - h+ps://manuel.bernhardt.io
Key issues for building clusters
• discovery: who's there?
• fault detec0on: who's in trouble?
• load balancing: who can take up work?
Group membership
@elmanu - h+ps://manuel.bernhardt.io
Implemen'ng group membership
1. Failure Detec.on
2. Dissemina.on
3. Consensus
@elmanu - h+ps://manuel.bernhardt.io
Failure detec,on
Wish you were here (1975)
Failure detector key
proper0es
• Completeness: crash-failure of any
group member is detected by all non-
faulty members
@elmanu - h+ps://manuel.bernhardt.io
Failure detector key
proper0es
• Completeness: crash-failure of any
group member is detected by all non-
faulty members
• Accuracy: no non-faulty group member
is declared as failed by any other non-
faulty group member (no false posi9ves)
@elmanu - h+ps://manuel.bernhardt.io
Failure detector key
proper0es
• Completeness: crash-failure of any group
member is detected by all non-faulty
members
• Accuracy: no non-faulty group member is
declared as failed by any other non-faulty
group member (no false posi9ves)
Also relevant in prac/ce:
• speed
• network message load
@elmanu - h+ps://manuel.bernhardt.io
Impossibility result
It is impossible for a failure detector algorithm to determinis3cally
achieve both completeness and accuracy over an asynchronous
unreliable network1
1
Chandra, Toueg: Unreliable failure detectors for reliable distributed systems (1996)
@elmanu - h+ps://manuel.bernhardt.io
Trade-offs
• Strong - Weak completeness: all / some non-faulty members
detect a crash
• Strong - Weak accuracy: there are no / some false-posi7ves
@elmanu - h+ps://manuel.bernhardt.io
Trade-offs
• Strong - Weak completeness: all / some non-faulty members
detect a crash
• Strong - Weak accuracy: there are no / some false-posi7ves
In prac(ce most applica(ons prefer strong completeness with a
weaker form of accuracy
@elmanu - h+ps://manuel.bernhardt.io
Phi Adap)ve Accrual
Failure Detector 3
• has a cool name
• adap.ve: adjusts to network condi.ons
• introduces the no.on of accrual failure
detec.on: suspicion value φ rather than
boolean (trusted or suspected)
3
N. Hayashibara et al: The ϕ Accrual Failure Detector (2004)
@elmanu - h+ps://manuel.bernhardt.io
Phi Adap)ve Accrual
Failure Detector 3
• has a cool name
• adap.ve: adjusts to network condi.ons
• introduces the no.on of accrual failure
detec.on: suspicion value φ rather than
boolean (trusted or suspected)
3
N. Hayashibara et al: The ϕ Accrual Failure Detector (2004)
@elmanu - h+ps://manuel.bernhardt.io
New Adap)ve accrual
Failure Detector 4
• much simpler to calculate suspicion
level than Phi
• performs slightly be7er and more
adap)ve 5
5
h$ps://manuel.bernhardt.io/2017/07/26/a-new-adap=ve-accrual-
failure-detector-for-akka/
4
B. Satzger et al: A new adap3ve accrual failure detector for dependable
distributed systems (2007)
@elmanu - h+ps://manuel.bernhardt.io
SWIM Failure Detector
As you swim lazily through the milieu,
The secrets of the world will infect you 6
• has both a dissemina.on and a failure detec.on component
• scalable membership protocol
• members are first suspected and not immediately flagged as
failed
6
A. Das et al: SWIM: scalable weakly-consistent infec:on-style process group membership protocol (2002)
@elmanu - h+ps://manuel.bernhardt.io
Lifeguard Failure Detector
• based on SWIM, developed by
Hashicorp 7
• memberlist implementa;on 8
• extensions to the SWIM protocol
• dras;cally reduces the amount of false-
posi;ves
8
h$ps://github.com/hashicorp/memberlist
7
A. Dadgar et al: Lifeguard: SWIM-ing with Situa:onal Awareness (2017)
@elmanu - h+ps://manuel.bernhardt.io
Dissemina(onPulse (1995)
Dissemina(on
How to communicate changes in the cluster?
• members joining
• members leaving
• members failing
@elmanu - h+ps://manuel.bernhardt.io
Dissemina(on strategies
• hardware / IP / UDP mul1cast: not
readily (or willingly) enabled in data
centres
• gossip protocols (P2P)
@elmanu - h+ps://manuel.bernhardt.io
Gossip styles
• gossip to one node at random 10
• round-robin, binary round-robin, round-
robin with sequence check 11
• piggy-back on another protocol (e.g. on
a failure detector 6
): also called
infec&on-style gossip
6
A. Das et al: SWIM: scalable weakly-consistent infec:on-style process
group membership protocol (2002)
11
S. Ranganathan et al: Gossip-Style Failure Detec:on and Distributed
Consensus for Scalable Heterogeneous Clusters (2000)
10
van Renesse et al: A gossip-style failure detec9on service (1998)
@elmanu - h+ps://manuel.bernhardt.io
Example of gossip op.miza.ons
(op$mized away due to lack of $me)
@elmanu - h+ps://manuel.bernhardt.io
ConsensusA momentary lapse of reason (1987)
Impossibility result - group
membership
Group membership with a single group is impossible when there
are nodes that are suspected of having failed 9
9
Chandra et al: On the Impossibility of Group Membership (1996)
@elmanu - h+ps://manuel.bernhardt.io
It would be unwise to make
membership-related decisions while
there are processes suspected of
having crashed
@elmanu - h+ps://manuel.bernhardt.io
Reaching consensus: .me
• Lamport Clocks 12
: how do you order events in a distributed
system
12
L. Lamport: Time, Clocks, and the Ordering of Events in a Distributed System (1978)
@elmanu - h+ps://manuel.bernhardt.io
Reaching consensus: .me
• Lamport Clocks: how do you order events in a distributed
system
• Vector Clocks 13
: how do you order events in a distributed
system and flag concurrent event
13
F. Ma(ern: Virtual Time and Global States of Distributed Systems (1989)
@elmanu - h+ps://manuel.bernhardt.io
Reaching consensus: .me
• Lamport Clocks: how do you order events in a distributed system
• Vector Clocks: how do you order events in a distributed system and flag
concurrent events
• Version Vectors 14 15
and Do3ed Version Vectors 16
: very similar but
seman;cs primarily concerned with versioning and conflict detec;on in
replicas
16
N. Preguiça: Do1ed Version Vectors: Efficient Causality Tracking for Distributed Key-Value Stores (2012)
15
h%ps://haslab.wordpress.com/2011/07/08/version-vectors-are-not-vector-clocks/
14
D.S. Parker: Detec/on of mutual inconsistency in distributed systems (1983)
@elmanu - h+ps://manuel.bernhardt.io
Reaching consensus: .me
private[cluster] final case class Gossip(
members: immutable.SortedSet[Member],
overview: GossipOverview = GossipOverview(),
version: VectorClock = VectorClock(),
tombstones: Map[UniqueAddress, Gossip.Timestamp] = Map.empty)
@elmanu - h+ps://manuel.bernhardt.io
Reaching consensus:
replicated state machines
This method allows one to implement any
desired form of mul4process
synchroniza4on in a distributed system
— Leslie Lamport 12
12
L. Lamport: Time, Clocks, and the Ordering of Events in a Distributed
System (1978)
@elmanu - h+ps://manuel.bernhardt.io
Reaching consensus:
protocols
• fault-tolerant distributed systems
• how do mul1ple servers agree on a
value?
• Paxos 19 20
, Ra@ 21
, CASPaxos 22
22
D. Rystsov: CASPaxos: Replicated State Machines without logs (2018)
21
D. Ongaro and J. Ousterhout: In Search of an Understandable
Consensus Algorithm (Extended Version) (2014)
20
L. Lamport: Paxos made simple (2001)
19
L. Lamport: The Part-Time Parliament (1998)
@elmanu - h+ps://manuel.bernhardt.io
Reaching consensus:
CRDTs
• Conflict-Free Replicated Data types 17
• strong eventual consistency
• two families:
• CmRDTs (commuta+vity of
opera+ons)
• CvRDTs (convergence of state - merge
funcBon)
17
F.B. Schneider: Implemen4ng Fault Tolerant Services Using the State
Machine Approach: A Tutorial (1990)
@elmanu - h+ps://manuel.bernhardt.io
Reaching consensus: conven/ons
• reaching a decision by not transmi2ng any informa4on
• example: Akka Cluster leader designa4on
/**
* INTERNAL API
* Orders the members by their address except that members with status
* Joining, Exiting and Down are ordered last (in that order).
*/
private[cluster] val leaderStatusOrdering: Ordering[Member] = ...
@elmanu - h+ps://manuel.bernhardt.io
Example: Akka Cluster
@elmanu - h+ps://manuel.bernhardt.io
Akka Cluster
• failure detector: φ Adap)ve Accrual FD
with ping-pong
• dissemina0on: random biased gossip
• consensus:
• leader by conven)on
• membership decisions driven by
leader (joining, leaving)
@elmanu - h+ps://manuel.bernhardt.io
Akka Cluster: happy path
@elmanu - h+ps://manuel.bernhardt.io
Akka Cluster: sad path (aka reality)
@elmanu - h+ps://manuel.bernhardt.io
Akka Cluster: how do you even
@elmanu - h+ps://manuel.bernhardt.io
h#ps://manuel.bernhardt.io
Failure detectors
• Chandra, Toueg: Unreliable failure detectors for reliable distributed systems (1996)
• N. Hayashibara et al: The ϕ Accrual Failure Detector (2004)
• B. Satzger et al: A new adapNve accrual failure detector for dependable distributed systems
(2007)
• hQps://manuel.bernhardt.io/2017/07/26/a-new-adapNve-accrual-failure-detector-for-akka/
• A. Das et al: SWIM: scalable weakly-consistent infecNon-style process group membership
protocol (2002)
• A. Dadgar et al: Lifeguard: SWIM-ing with SituaNonal Awareness (2017)
• hQps://github.com/hashicorp/memberlist
@elmanu - h+ps://manuel.bernhardt.io
Impossibility results
• M.J. Fischer, N.A. Lynch, and M.S. Paterson: Impossibility of
distributed consensus with one faulty process (1985)
• Chandra, Toueg: Unreliable failure detectors for reliable
distributed systems (1996)
• Chandra et al: On the Impossibility of Group Membership (1996)
@elmanu - h+ps://manuel.bernhardt.io
Dissemina(on
• van Renesse et al: A gossip-style failure detec8on service (1998)
• S. Ranganathan et al: Gossip-Style Failure Detec8on and
Distributed Consensus for Scalable Heterogeneous Clusters
(2000)
@elmanu - h+ps://manuel.bernhardt.io
Consensus - )me
• L. Lamport: Time, Clocks, and the Ordering of Events in a Distributed
System (1978)
• F. MaJern: Virtual Time and Global States of Distributed Systems (1989)
• D.S. Parker: DetecNon of mutual inconsistency in distributed systems (1983)
• hJps://haslab.wordpress.com/2011/07/08/version-vectors-are-not-vector-
clocks/
• N. Preguiça: DoJed Version Vectors: Efficient Causality Tracking for
Distributed Key-Value Stores (2012)
@elmanu - h+ps://manuel.bernhardt.io
Consensus - protocols
• F.B. Schneider: Implemen3ng Fault Tolerant Services Using the State
Machine Approach: A Tutorial (1990)
• L. Lamport: The Part-Time Parliament (1998)
• L. Lamport: Paxos made simple (2001)
• D. Ongaro and J. Ousterhout: In Search of an Understandable
Consensus Algorithm (Extended Version) (2014)
• D. Rystsov: CASPaxos: Replicated State Machines without logs (2018)
@elmanu - h+ps://manuel.bernhardt.io
Consensus - misc
• M. Shapiro: Conflict-free Replicated Data Types (2011)
@elmanu - h+ps://manuel.bernhardt.io
Thank you!
• Website: h+ps://manuel.bernhardt.io
• Twi+er: @elmanu

More Related Content

Similar to Is there anybody out there?

The Computer Science Behind a modern Distributed Database
The Computer Science Behind a modern Distributed DatabaseThe Computer Science Behind a modern Distributed Database
The Computer Science Behind a modern Distributed DatabaseArangoDB Database
 
Distributed Systems Theory for Mere Mortals
Distributed Systems Theory for Mere MortalsDistributed Systems Theory for Mere Mortals
Distributed Systems Theory for Mere MortalsEnsar Basri Kahveci
 
Ha cluster with openSUSE Leap
Ha cluster with openSUSE LeapHa cluster with openSUSE Leap
Ha cluster with openSUSE Leapmedwinz
 
Migrating from One Cloud Provider to Another (Without Losing Your Data or You...
Migrating from One Cloud Provider to Another (Without Losing Your Data or You...Migrating from One Cloud Provider to Another (Without Losing Your Data or You...
Migrating from One Cloud Provider to Another (Without Losing Your Data or You...HostedbyConfluent
 
Tradeoffs in Automatic Provenance Capture
Tradeoffs in Automatic Provenance CaptureTradeoffs in Automatic Provenance Capture
Tradeoffs in Automatic Provenance CapturePaul Groth
 
Debunking Six Common Myths in Stream Processing
Debunking Six Common Myths in Stream ProcessingDebunking Six Common Myths in Stream Processing
Debunking Six Common Myths in Stream ProcessingKostas Tzoumas
 
Web Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: IntroductionWeb Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: IntroductionKatrien Verbert
 
From complex Systems to Networks: Discovering and Modeling the Correct Network"
From complex Systems to Networks: Discovering and Modeling the Correct Network"From complex Systems to Networks: Discovering and Modeling the Correct Network"
From complex Systems to Networks: Discovering and Modeling the Correct Network"diannepatricia
 
OSDC 2018 | The Computer science behind a modern distributed data store by Ma...
OSDC 2018 | The Computer science behind a modern distributed data store by Ma...OSDC 2018 | The Computer science behind a modern distributed data store by Ma...
OSDC 2018 | The Computer science behind a modern distributed data store by Ma...NETWAYS
 
An introduction to R is a document useful
An introduction to R is a document usefulAn introduction to R is a document useful
An introduction to R is a document usefulssuser3c3f88
 
CHARMe and the NCPP group
CHARMe and the NCPP groupCHARMe and the NCPP group
CHARMe and the NCPP groupRaquel Alegre
 
The computer science behind a modern disributed data store
The computer science behind a modern disributed data storeThe computer science behind a modern disributed data store
The computer science behind a modern disributed data storeJ On The Beach
 
An Open Source Strategy for NASA
An Open Source Strategy for NASAAn Open Source Strategy for NASA
An Open Source Strategy for NASAChris Mattmann
 
Clickstream data with spark
Clickstream data with sparkClickstream data with spark
Clickstream data with sparkMarissa Saunders
 

Similar to Is there anybody out there? (20)

test
testtest
test
 
HeartBeat
HeartBeatHeartBeat
HeartBeat
 
The Computer Science Behind a modern Distributed Database
The Computer Science Behind a modern Distributed DatabaseThe Computer Science Behind a modern Distributed Database
The Computer Science Behind a modern Distributed Database
 
Distributed Systems Theory for Mere Mortals
Distributed Systems Theory for Mere MortalsDistributed Systems Theory for Mere Mortals
Distributed Systems Theory for Mere Mortals
 
Introduction
IntroductionIntroduction
Introduction
 
Ha cluster with openSUSE Leap
Ha cluster with openSUSE LeapHa cluster with openSUSE Leap
Ha cluster with openSUSE Leap
 
Migrating from One Cloud Provider to Another (Without Losing Your Data or You...
Migrating from One Cloud Provider to Another (Without Losing Your Data or You...Migrating from One Cloud Provider to Another (Without Losing Your Data or You...
Migrating from One Cloud Provider to Another (Without Losing Your Data or You...
 
Tradeoffs in Automatic Provenance Capture
Tradeoffs in Automatic Provenance CaptureTradeoffs in Automatic Provenance Capture
Tradeoffs in Automatic Provenance Capture
 
Debunking Six Common Myths in Stream Processing
Debunking Six Common Myths in Stream ProcessingDebunking Six Common Myths in Stream Processing
Debunking Six Common Myths in Stream Processing
 
Web Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: IntroductionWeb Information Systems Lecture 1: Introduction
Web Information Systems Lecture 1: Introduction
 
From complex Systems to Networks: Discovering and Modeling the Correct Network"
From complex Systems to Networks: Discovering and Modeling the Correct Network"From complex Systems to Networks: Discovering and Modeling the Correct Network"
From complex Systems to Networks: Discovering and Modeling the Correct Network"
 
OSDC 2018 | The Computer science behind a modern distributed data store by Ma...
OSDC 2018 | The Computer science behind a modern distributed data store by Ma...OSDC 2018 | The Computer science behind a modern distributed data store by Ma...
OSDC 2018 | The Computer science behind a modern distributed data store by Ma...
 
An introduction to R is a document useful
An introduction to R is a document usefulAn introduction to R is a document useful
An introduction to R is a document useful
 
CHARMe and the NCPP group
CHARMe and the NCPP groupCHARMe and the NCPP group
CHARMe and the NCPP group
 
r merged.pdf
r merged.pdfr merged.pdf
r merged.pdf
 
The computer science behind a modern disributed data store
The computer science behind a modern disributed data storeThe computer science behind a modern disributed data store
The computer science behind a modern disributed data store
 
An Open Source Strategy for NASA
An Open Source Strategy for NASAAn Open Source Strategy for NASA
An Open Source Strategy for NASA
 
SRECon Coherent Performance
SRECon Coherent PerformanceSRECon Coherent Performance
SRECon Coherent Performance
 
2011 NASA Open Source Summit - Chris Mattmann
2011 NASA Open Source Summit - Chris Mattmann2011 NASA Open Source Summit - Chris Mattmann
2011 NASA Open Source Summit - Chris Mattmann
 
Clickstream data with spark
Clickstream data with sparkClickstream data with spark
Clickstream data with spark
 

More from Manuel Bernhardt

8 akka anti-patterns you'd better be aware of - Reactive Summit Austin 2017
8 akka anti-patterns you'd better be aware of - Reactive Summit Austin 20178 akka anti-patterns you'd better be aware of - Reactive Summit Austin 2017
8 akka anti-patterns you'd better be aware of - Reactive Summit Austin 2017Manuel Bernhardt
 
Scala Days Copenhagen - 8 Akka anti-patterns you'd better be aware of
Scala Days Copenhagen - 8 Akka anti-patterns you'd better be aware ofScala Days Copenhagen - 8 Akka anti-patterns you'd better be aware of
Scala Days Copenhagen - 8 Akka anti-patterns you'd better be aware ofManuel Bernhardt
 
8 Akka anti-patterns you'd better be aware of
8 Akka anti-patterns you'd better be aware of8 Akka anti-patterns you'd better be aware of
8 Akka anti-patterns you'd better be aware ofManuel Bernhardt
 
Beyond the buzzword: a reactive web-appliction in practice
Beyond the buzzword: a reactive web-appliction in practiceBeyond the buzzword: a reactive web-appliction in practice
Beyond the buzzword: a reactive web-appliction in practiceManuel Bernhardt
 
Beyond the Buzzword - a reactive application in practice
Beyond the Buzzword - a reactive application in practiceBeyond the Buzzword - a reactive application in practice
Beyond the Buzzword - a reactive application in practiceManuel Bernhardt
 
Six years of Scala and counting
Six years of Scala and countingSix years of Scala and counting
Six years of Scala and countingManuel Bernhardt
 
3 things you must know to think reactive - Geecon Kraków 2015
3 things you must know to think reactive - Geecon Kraków 20153 things you must know to think reactive - Geecon Kraków 2015
3 things you must know to think reactive - Geecon Kraków 2015Manuel Bernhardt
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysManuel Bernhardt
 
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMVoxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMManuel Bernhardt
 
Back to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migrationBack to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migrationManuel Bernhardt
 
Project Phoenix - From PHP to the Play Framework in 3 months
Project Phoenix - From PHP to the Play Framework in 3 monthsProject Phoenix - From PHP to the Play Framework in 3 months
Project Phoenix - From PHP to the Play Framework in 3 monthsManuel Bernhardt
 
Tips and tricks for setting up a Play 2 project
Tips and tricks for setting up a Play 2 projectTips and tricks for setting up a Play 2 project
Tips and tricks for setting up a Play 2 projectManuel Bernhardt
 

More from Manuel Bernhardt (16)

8 akka anti-patterns you'd better be aware of - Reactive Summit Austin 2017
8 akka anti-patterns you'd better be aware of - Reactive Summit Austin 20178 akka anti-patterns you'd better be aware of - Reactive Summit Austin 2017
8 akka anti-patterns you'd better be aware of - Reactive Summit Austin 2017
 
Scala Days Copenhagen - 8 Akka anti-patterns you'd better be aware of
Scala Days Copenhagen - 8 Akka anti-patterns you'd better be aware ofScala Days Copenhagen - 8 Akka anti-patterns you'd better be aware of
Scala Days Copenhagen - 8 Akka anti-patterns you'd better be aware of
 
8 Akka anti-patterns you'd better be aware of
8 Akka anti-patterns you'd better be aware of8 Akka anti-patterns you'd better be aware of
8 Akka anti-patterns you'd better be aware of
 
Beyond the buzzword: a reactive web-appliction in practice
Beyond the buzzword: a reactive web-appliction in practiceBeyond the buzzword: a reactive web-appliction in practice
Beyond the buzzword: a reactive web-appliction in practice
 
Beyond the Buzzword - a reactive application in practice
Beyond the Buzzword - a reactive application in practiceBeyond the Buzzword - a reactive application in practice
Beyond the Buzzword - a reactive application in practice
 
Six years of Scala and counting
Six years of Scala and countingSix years of Scala and counting
Six years of Scala and counting
 
3 things you must know to think reactive - Geecon Kraków 2015
3 things you must know to think reactive - Geecon Kraków 20153 things you must know to think reactive - Geecon Kraków 2015
3 things you must know to think reactive - Geecon Kraków 2015
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDays
 
Writing a technical book
Writing a technical bookWriting a technical book
Writing a technical book
 
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMVoxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
 
Back to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migrationBack to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migration
 
Project Phoenix - From PHP to the Play Framework in 3 months
Project Phoenix - From PHP to the Play Framework in 3 monthsProject Phoenix - From PHP to the Play Framework in 3 months
Project Phoenix - From PHP to the Play Framework in 3 months
 
Scala - Java2Days Sofia
Scala - Java2Days SofiaScala - Java2Days Sofia
Scala - Java2Days Sofia
 
Tips and tricks for setting up a Play 2 project
Tips and tricks for setting up a Play 2 projectTips and tricks for setting up a Play 2 project
Tips and tricks for setting up a Play 2 project
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Scala pitfalls
Scala pitfallsScala pitfalls
Scala pitfalls
 

Recently uploaded

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Recently uploaded (20)

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

Is there anybody out there?

  • 1. Is there anybody out there? Scalar Conference Warsaw 2018 Manuel Bernhardt
  • 2. Disclaimer [A career in distributed systems] is both exhilara6ng and frustra6ng. When things work, it's like a symphony. When they don't, it's like an eleventh-birthday party where half of the kids are on speed. — Jeff Darcy, HekaFS (formerly CloudFS) project lead @elmanu - h+ps://manuel.bernhardt.io
  • 3.
  • 4. manuel.bernhardt.io • Guiding companies that want to get started with reac4ve systems • Lightbend consul4ng and training partner (Akka Cluster, Akka Streams) • Scuba-diver, currently stranded in Austria
  • 5. Mo#va#onal quote Life is a single player game. You’re born alone. You’re going to die alone. All of your interpreta8ons are alone. All your memories are alone. You’re gone in three genera8ons and no one cares. Before you showed up nobody cared. It’s all single player. — Naval Ravikant @elmanu - h+ps://manuel.bernhardt.io
  • 6.
  • 7.
  • 8.
  • 9. Key issues for building clusters • discovery: who's there? • fault detec0on: who's in trouble? • load balancing: who can take up work? @elmanu - h+ps://manuel.bernhardt.io
  • 10. Key issues for building clusters • discovery: who's there? • fault detec0on: who's in trouble? • load balancing: who can take up work? Group membership @elmanu - h+ps://manuel.bernhardt.io
  • 11. Implemen'ng group membership 1. Failure Detec.on 2. Dissemina.on 3. Consensus @elmanu - h+ps://manuel.bernhardt.io
  • 12.
  • 13. Failure detec,on Wish you were here (1975)
  • 14. Failure detector key proper0es • Completeness: crash-failure of any group member is detected by all non- faulty members @elmanu - h+ps://manuel.bernhardt.io
  • 15. Failure detector key proper0es • Completeness: crash-failure of any group member is detected by all non- faulty members • Accuracy: no non-faulty group member is declared as failed by any other non- faulty group member (no false posi9ves) @elmanu - h+ps://manuel.bernhardt.io
  • 16. Failure detector key proper0es • Completeness: crash-failure of any group member is detected by all non-faulty members • Accuracy: no non-faulty group member is declared as failed by any other non-faulty group member (no false posi9ves) Also relevant in prac/ce: • speed • network message load @elmanu - h+ps://manuel.bernhardt.io
  • 17. Impossibility result It is impossible for a failure detector algorithm to determinis3cally achieve both completeness and accuracy over an asynchronous unreliable network1 1 Chandra, Toueg: Unreliable failure detectors for reliable distributed systems (1996) @elmanu - h+ps://manuel.bernhardt.io
  • 18. Trade-offs • Strong - Weak completeness: all / some non-faulty members detect a crash • Strong - Weak accuracy: there are no / some false-posi7ves @elmanu - h+ps://manuel.bernhardt.io
  • 19. Trade-offs • Strong - Weak completeness: all / some non-faulty members detect a crash • Strong - Weak accuracy: there are no / some false-posi7ves In prac(ce most applica(ons prefer strong completeness with a weaker form of accuracy @elmanu - h+ps://manuel.bernhardt.io
  • 20. Phi Adap)ve Accrual Failure Detector 3 • has a cool name • adap.ve: adjusts to network condi.ons • introduces the no.on of accrual failure detec.on: suspicion value φ rather than boolean (trusted or suspected) 3 N. Hayashibara et al: The ϕ Accrual Failure Detector (2004) @elmanu - h+ps://manuel.bernhardt.io
  • 21. Phi Adap)ve Accrual Failure Detector 3 • has a cool name • adap.ve: adjusts to network condi.ons • introduces the no.on of accrual failure detec.on: suspicion value φ rather than boolean (trusted or suspected) 3 N. Hayashibara et al: The ϕ Accrual Failure Detector (2004) @elmanu - h+ps://manuel.bernhardt.io
  • 22. New Adap)ve accrual Failure Detector 4 • much simpler to calculate suspicion level than Phi • performs slightly be7er and more adap)ve 5 5 h$ps://manuel.bernhardt.io/2017/07/26/a-new-adap=ve-accrual- failure-detector-for-akka/ 4 B. Satzger et al: A new adap3ve accrual failure detector for dependable distributed systems (2007) @elmanu - h+ps://manuel.bernhardt.io
  • 23. SWIM Failure Detector As you swim lazily through the milieu, The secrets of the world will infect you 6 • has both a dissemina.on and a failure detec.on component • scalable membership protocol • members are first suspected and not immediately flagged as failed 6 A. Das et al: SWIM: scalable weakly-consistent infec:on-style process group membership protocol (2002) @elmanu - h+ps://manuel.bernhardt.io
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. Lifeguard Failure Detector • based on SWIM, developed by Hashicorp 7 • memberlist implementa;on 8 • extensions to the SWIM protocol • dras;cally reduces the amount of false- posi;ves 8 h$ps://github.com/hashicorp/memberlist 7 A. Dadgar et al: Lifeguard: SWIM-ing with Situa:onal Awareness (2017) @elmanu - h+ps://manuel.bernhardt.io
  • 31.
  • 33. Dissemina(on How to communicate changes in the cluster? • members joining • members leaving • members failing @elmanu - h+ps://manuel.bernhardt.io
  • 34. Dissemina(on strategies • hardware / IP / UDP mul1cast: not readily (or willingly) enabled in data centres • gossip protocols (P2P) @elmanu - h+ps://manuel.bernhardt.io
  • 35. Gossip styles • gossip to one node at random 10 • round-robin, binary round-robin, round- robin with sequence check 11 • piggy-back on another protocol (e.g. on a failure detector 6 ): also called infec&on-style gossip 6 A. Das et al: SWIM: scalable weakly-consistent infec:on-style process group membership protocol (2002) 11 S. Ranganathan et al: Gossip-Style Failure Detec:on and Distributed Consensus for Scalable Heterogeneous Clusters (2000) 10 van Renesse et al: A gossip-style failure detec9on service (1998) @elmanu - h+ps://manuel.bernhardt.io
  • 36. Example of gossip op.miza.ons (op$mized away due to lack of $me) @elmanu - h+ps://manuel.bernhardt.io
  • 37.
  • 38. ConsensusA momentary lapse of reason (1987)
  • 39. Impossibility result - group membership Group membership with a single group is impossible when there are nodes that are suspected of having failed 9 9 Chandra et al: On the Impossibility of Group Membership (1996) @elmanu - h+ps://manuel.bernhardt.io
  • 40. It would be unwise to make membership-related decisions while there are processes suspected of having crashed @elmanu - h+ps://manuel.bernhardt.io
  • 41. Reaching consensus: .me • Lamport Clocks 12 : how do you order events in a distributed system 12 L. Lamport: Time, Clocks, and the Ordering of Events in a Distributed System (1978) @elmanu - h+ps://manuel.bernhardt.io
  • 42. Reaching consensus: .me • Lamport Clocks: how do you order events in a distributed system • Vector Clocks 13 : how do you order events in a distributed system and flag concurrent event 13 F. Ma(ern: Virtual Time and Global States of Distributed Systems (1989) @elmanu - h+ps://manuel.bernhardt.io
  • 43. Reaching consensus: .me • Lamport Clocks: how do you order events in a distributed system • Vector Clocks: how do you order events in a distributed system and flag concurrent events • Version Vectors 14 15 and Do3ed Version Vectors 16 : very similar but seman;cs primarily concerned with versioning and conflict detec;on in replicas 16 N. Preguiça: Do1ed Version Vectors: Efficient Causality Tracking for Distributed Key-Value Stores (2012) 15 h%ps://haslab.wordpress.com/2011/07/08/version-vectors-are-not-vector-clocks/ 14 D.S. Parker: Detec/on of mutual inconsistency in distributed systems (1983) @elmanu - h+ps://manuel.bernhardt.io
  • 44. Reaching consensus: .me private[cluster] final case class Gossip( members: immutable.SortedSet[Member], overview: GossipOverview = GossipOverview(), version: VectorClock = VectorClock(), tombstones: Map[UniqueAddress, Gossip.Timestamp] = Map.empty) @elmanu - h+ps://manuel.bernhardt.io
  • 45. Reaching consensus: replicated state machines This method allows one to implement any desired form of mul4process synchroniza4on in a distributed system — Leslie Lamport 12 12 L. Lamport: Time, Clocks, and the Ordering of Events in a Distributed System (1978) @elmanu - h+ps://manuel.bernhardt.io
  • 46. Reaching consensus: protocols • fault-tolerant distributed systems • how do mul1ple servers agree on a value? • Paxos 19 20 , Ra@ 21 , CASPaxos 22 22 D. Rystsov: CASPaxos: Replicated State Machines without logs (2018) 21 D. Ongaro and J. Ousterhout: In Search of an Understandable Consensus Algorithm (Extended Version) (2014) 20 L. Lamport: Paxos made simple (2001) 19 L. Lamport: The Part-Time Parliament (1998) @elmanu - h+ps://manuel.bernhardt.io
  • 47. Reaching consensus: CRDTs • Conflict-Free Replicated Data types 17 • strong eventual consistency • two families: • CmRDTs (commuta+vity of opera+ons) • CvRDTs (convergence of state - merge funcBon) 17 F.B. Schneider: Implemen4ng Fault Tolerant Services Using the State Machine Approach: A Tutorial (1990) @elmanu - h+ps://manuel.bernhardt.io
  • 48. Reaching consensus: conven/ons • reaching a decision by not transmi2ng any informa4on • example: Akka Cluster leader designa4on /** * INTERNAL API * Orders the members by their address except that members with status * Joining, Exiting and Down are ordered last (in that order). */ private[cluster] val leaderStatusOrdering: Ordering[Member] = ... @elmanu - h+ps://manuel.bernhardt.io
  • 49. Example: Akka Cluster @elmanu - h+ps://manuel.bernhardt.io
  • 50. Akka Cluster • failure detector: φ Adap)ve Accrual FD with ping-pong • dissemina0on: random biased gossip • consensus: • leader by conven)on • membership decisions driven by leader (joining, leaving) @elmanu - h+ps://manuel.bernhardt.io
  • 51. Akka Cluster: happy path @elmanu - h+ps://manuel.bernhardt.io
  • 52. Akka Cluster: sad path (aka reality) @elmanu - h+ps://manuel.bernhardt.io
  • 53. Akka Cluster: how do you even @elmanu - h+ps://manuel.bernhardt.io
  • 54.
  • 56. Failure detectors • Chandra, Toueg: Unreliable failure detectors for reliable distributed systems (1996) • N. Hayashibara et al: The ϕ Accrual Failure Detector (2004) • B. Satzger et al: A new adapNve accrual failure detector for dependable distributed systems (2007) • hQps://manuel.bernhardt.io/2017/07/26/a-new-adapNve-accrual-failure-detector-for-akka/ • A. Das et al: SWIM: scalable weakly-consistent infecNon-style process group membership protocol (2002) • A. Dadgar et al: Lifeguard: SWIM-ing with SituaNonal Awareness (2017) • hQps://github.com/hashicorp/memberlist @elmanu - h+ps://manuel.bernhardt.io
  • 57. Impossibility results • M.J. Fischer, N.A. Lynch, and M.S. Paterson: Impossibility of distributed consensus with one faulty process (1985) • Chandra, Toueg: Unreliable failure detectors for reliable distributed systems (1996) • Chandra et al: On the Impossibility of Group Membership (1996) @elmanu - h+ps://manuel.bernhardt.io
  • 58. Dissemina(on • van Renesse et al: A gossip-style failure detec8on service (1998) • S. Ranganathan et al: Gossip-Style Failure Detec8on and Distributed Consensus for Scalable Heterogeneous Clusters (2000) @elmanu - h+ps://manuel.bernhardt.io
  • 59. Consensus - )me • L. Lamport: Time, Clocks, and the Ordering of Events in a Distributed System (1978) • F. MaJern: Virtual Time and Global States of Distributed Systems (1989) • D.S. Parker: DetecNon of mutual inconsistency in distributed systems (1983) • hJps://haslab.wordpress.com/2011/07/08/version-vectors-are-not-vector- clocks/ • N. Preguiça: DoJed Version Vectors: Efficient Causality Tracking for Distributed Key-Value Stores (2012) @elmanu - h+ps://manuel.bernhardt.io
  • 60. Consensus - protocols • F.B. Schneider: Implemen3ng Fault Tolerant Services Using the State Machine Approach: A Tutorial (1990) • L. Lamport: The Part-Time Parliament (1998) • L. Lamport: Paxos made simple (2001) • D. Ongaro and J. Ousterhout: In Search of an Understandable Consensus Algorithm (Extended Version) (2014) • D. Rystsov: CASPaxos: Replicated State Machines without logs (2018) @elmanu - h+ps://manuel.bernhardt.io
  • 61. Consensus - misc • M. Shapiro: Conflict-free Replicated Data Types (2011) @elmanu - h+ps://manuel.bernhardt.io
  • 62. Thank you! • Website: h+ps://manuel.bernhardt.io • Twi+er: @elmanu