SlideShare a Scribd company logo
1 of 42
Download to read offline
Go Reactive 
Event-Driven, Scalable, Resilient & Responsive Systems 
Mirco Dotta 
@mircodotta
The Four Reactive Traits 
Reactive 
Applications 
2 
http://reactivemanifesto.org/
Starting Point: 
The User
The User browser
browser 
frontend 
server 
internal 
service storage 
internal 
service 
DB 
external 
service
Responsiveness 
! 
always available 
interactive 
(near) real-time
Bounded Latency 
6
Bounded Latency 
• fan-out in parallel and aggregate 
6
Bounded Latency 
• fan-out in parallel and aggregate 
6 
A B C
Bounded Latency 
• fan-out in parallel and aggregate 
6 
A 
B 
C
Bounded Latency 
• fan-out in parallel and aggregate 
6 
A 
B 
C 
e
Bounded Latency 
• fan-out in parallel and aggregate 
• use circuit breakers for graceful degradation 
7
Bounded Latency 
• fan-out in parallel and aggregate 
• use circuit breakers for graceful degradation 
7 
do work 
fail fast
Bounded Latency 
• fan-out in parallel and aggregate 
• use circuit breakers for graceful degradation 
• use bounded queues, measure flow rates 
8
Bounded Latency 
• fan-out in parallel and aggregate 
• use circuit breakers for graceful degradation 
• use bounded queues, measure flow rates 
8 
Use Bounded Queues: 
! 
Latency = QueueLength • ProcessingTime 
! 
(for reasonably stable average processing time)
Bounded Latency 
• fan-out in parallel and aggregate 
• use circuit breakers for graceful degradation 
• use bounded queues, measure flow rates 
8 
Use Bounded Queues: 
! 
Latency = QueueLength • ProcessingTime 
! 
(for reasonably stable average processing time) 
m
Resilience 
! 
Responsive in the Face of Failure
Handle Failure 
• software will fail 
• hardware will fail 
• humans will fail 
• system still needs to respond ➟ resilience 
10
Distribute! 
11
Asynchronous Failure 
• parallel fan-out & distribution 
➟ asynchronous execution 
• compartmentalization & isolation 
• no response? ➟ timeout events 
• someone else’s exception? ➟ supervision 
12
Asynchronous Failure 
• parallel fan-out & distribution 
➟ asynchronous execution 
• compartmentalization & isolation 
• no response? ➟ timeout events 
• someone else’s exception? ➟ supervision 
12
Asynchronous Failure 
• parallel fan-out & distribution 
➟ asynchronous execution 
• compartmentalization & isolation 
• no response? ➟ timeout events 
• someone else’s exception? ➟ supervision 
12 
Request 
Response 
Failure
Asynchronous Failure 
• parallel fan-out & distribution 
➟ asynchronous execution 
driven 
message-• compartmentalization & isolation 
• no response? ➟ timeout events 
• someone else’s exception? ➟ supervision 
12 
Request 
Response 
Failure
Asynchronous Failure 
• parallel fan-out & distribution 
➟ asynchronous execution 
• compartmentalization & isolation 
• no response? ➟ timeout events 
• someone else’s exception? ➟ supervision 
• location transparency ➟ seamless resilience 
12
Elasticity 
! 
Responsive in the Face of Changing Load
Handle Load 
14
Handle Load 
14
Handle Load 
• partition incoming work for distribution 
• share nothing 
• scale capacity up and down on demand 
• supervise and adapt 
• location transparency 
➟ seamless scalability 
14
Handle Load 
• partition incoming work for distribution 
• share nothing 
• scale capacity up and down on demand 
• supervise and adapt 
• location transparency 
➟ seamless scalability 
14 
m
… this has some interesting consequences!
Consequences 
• distribution & scalability 
➟ loss of strong consistency 
• CAP theorem? — not as relevant as you think 
• eventual consistency 
➟ gossip, heartbeats, dissemination of change 
! 
16
Consequences 
• distribution & scalability 
➟ loss of strong consistency 
• CAP theorem? — not as relevant as you think 
• eventual consistency 
➟ gossip, heartbeats, dissemination of change 
! 
16 
m
Corollary 
• Reactive needs to be applied all the way down 
17
But what about us, 
the developers?
Step 1: Take a Leap of Faith 
• thread-based models have made us defensive 
• “don’t let go of your thread!” 
• “asynchrony is suspicious” 
• “better return strict value, even if that needs blocking” 
19
Step 1: Take a Leap of Faith 
• thread-based models have made us defensive 
• “don’t let go of your thread!” 
• “asynchrony is suspicious” 
• “better return strict value, even if that needs blocking” 
• it is okay to write a method that returns a Future! 
19
Step 2: Rethink the Architecture 
• break out of the synchronous blocking prison 
• focus on communication & protocols 
• asynchronous program flow 
➟ no step-through debugging 
➟ tracing and monitoring 
• loose coupling 
20
Step 3: Profit! 
• clean business logic, 
separate from failure handling 
• distributable units of work 
• effortless parallelization 
21
Step 3: Profit! 
• clean business logic, 
separate from failure handling 
• distributable units of work 
• effortless parallelization 
• less assumptions ➟ lower maintenance cost 
21
Summary
The Four Reactive Traits 
Reactive 
Applications 
23 
http://reactivemanifesto.org/
All credit for this great slidedeck goes to Roland Kuhn (@rolandkuhn), 
while any inaccuracy is mine. 
©Typesafe 2014 – All Rights Reserved

More Related Content

Similar to Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems (Soft-Shake 2014)

What is Reactive programming?
What is Reactive programming?What is Reactive programming?
What is Reactive programming?Kevin Webber
 
Building Highly Available Apps on Cassandra (Robbie Strickland, Weather Compa...
Building Highly Available Apps on Cassandra (Robbie Strickland, Weather Compa...Building Highly Available Apps on Cassandra (Robbie Strickland, Weather Compa...
Building Highly Available Apps on Cassandra (Robbie Strickland, Weather Compa...DataStax
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8Heartin Jacob
 
Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems
Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven SystemsGo Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems
Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven SystemsJonas Bonér
 
CAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and PracticesCAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and PracticesYoav Francis
 
Large Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Large Scale Architecture -- The Unreasonable Effectiveness of SimplicityLarge Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Large Scale Architecture -- The Unreasonable Effectiveness of SimplicityRandy Shoup
 
Building a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerBuilding a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerTomas Doran
 
Building a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpBuilding a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpdotCloud
 
Building a Smarter Application Stack
Building a Smarter Application StackBuilding a Smarter Application Stack
Building a Smarter Application StackDocker, Inc.
 
Object-oriented design principles
Object-oriented design principlesObject-oriented design principles
Object-oriented design principlesXiaoyan Chen
 
Building on quicksand microservices indicthreads
Building on quicksand microservices  indicthreadsBuilding on quicksand microservices  indicthreads
Building on quicksand microservices indicthreadsIndicThreads
 
Fault tolerant presentation
Fault tolerant presentationFault tolerant presentation
Fault tolerant presentationskadyan1
 
Designing Fault Tolerant Microservices
Designing Fault Tolerant MicroservicesDesigning Fault Tolerant Microservices
Designing Fault Tolerant MicroservicesOrkhan Gasimov
 
Fault Tolerance in Distributed Environment
Fault Tolerance in Distributed EnvironmentFault Tolerance in Distributed Environment
Fault Tolerance in Distributed EnvironmentOrkhan Gasimov
 
Parallel programming in .NET
Parallel programming in .NETParallel programming in .NET
Parallel programming in .NETPeter Csala
 
Scaling Your Architecture for the Long Term
Scaling Your Architecture for the Long TermScaling Your Architecture for the Long Term
Scaling Your Architecture for the Long TermRandy Shoup
 
Design for Scale / Surge 2010
Design for Scale / Surge 2010Design for Scale / Surge 2010
Design for Scale / Surge 2010Christopher Brown
 
Patterns of Distributed Application Design
Patterns of Distributed Application DesignPatterns of Distributed Application Design
Patterns of Distributed Application DesignGlobalLogic Ukraine
 
MongoDB World 2018: Tutorial - MongoDB Meets Chaos Monkey
MongoDB World 2018: Tutorial - MongoDB Meets Chaos MonkeyMongoDB World 2018: Tutorial - MongoDB Meets Chaos Monkey
MongoDB World 2018: Tutorial - MongoDB Meets Chaos MonkeyMongoDB
 
Tiger oracle
Tiger oracleTiger oracle
Tiger oracled0nn9n
 

Similar to Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems (Soft-Shake 2014) (20)

What is Reactive programming?
What is Reactive programming?What is Reactive programming?
What is Reactive programming?
 
Building Highly Available Apps on Cassandra (Robbie Strickland, Weather Compa...
Building Highly Available Apps on Cassandra (Robbie Strickland, Weather Compa...Building Highly Available Apps on Cassandra (Robbie Strickland, Weather Compa...
Building Highly Available Apps on Cassandra (Robbie Strickland, Weather Compa...
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8
 
Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems
Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven SystemsGo Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems
Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems
 
CAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and PracticesCAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and Practices
 
Large Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Large Scale Architecture -- The Unreasonable Effectiveness of SimplicityLarge Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Large Scale Architecture -- The Unreasonable Effectiveness of Simplicity
 
Building a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerBuilding a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for Docker
 
Building a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpBuilding a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from Yelp
 
Building a Smarter Application Stack
Building a Smarter Application StackBuilding a Smarter Application Stack
Building a Smarter Application Stack
 
Object-oriented design principles
Object-oriented design principlesObject-oriented design principles
Object-oriented design principles
 
Building on quicksand microservices indicthreads
Building on quicksand microservices  indicthreadsBuilding on quicksand microservices  indicthreads
Building on quicksand microservices indicthreads
 
Fault tolerant presentation
Fault tolerant presentationFault tolerant presentation
Fault tolerant presentation
 
Designing Fault Tolerant Microservices
Designing Fault Tolerant MicroservicesDesigning Fault Tolerant Microservices
Designing Fault Tolerant Microservices
 
Fault Tolerance in Distributed Environment
Fault Tolerance in Distributed EnvironmentFault Tolerance in Distributed Environment
Fault Tolerance in Distributed Environment
 
Parallel programming in .NET
Parallel programming in .NETParallel programming in .NET
Parallel programming in .NET
 
Scaling Your Architecture for the Long Term
Scaling Your Architecture for the Long TermScaling Your Architecture for the Long Term
Scaling Your Architecture for the Long Term
 
Design for Scale / Surge 2010
Design for Scale / Surge 2010Design for Scale / Surge 2010
Design for Scale / Surge 2010
 
Patterns of Distributed Application Design
Patterns of Distributed Application DesignPatterns of Distributed Application Design
Patterns of Distributed Application Design
 
MongoDB World 2018: Tutorial - MongoDB Meets Chaos Monkey
MongoDB World 2018: Tutorial - MongoDB Meets Chaos MonkeyMongoDB World 2018: Tutorial - MongoDB Meets Chaos Monkey
MongoDB World 2018: Tutorial - MongoDB Meets Chaos Monkey
 
Tiger oracle
Tiger oracleTiger oracle
Tiger oracle
 

More from mircodotta

Scala Past, Present & Future
Scala Past, Present & FutureScala Past, Present & Future
Scala Past, Present & Futuremircodotta
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)mircodotta
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Rightmircodotta
 
Akka streams scala italy2015
Akka streams scala italy2015Akka streams scala italy2015
Akka streams scala italy2015mircodotta
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)mircodotta
 
Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)mircodotta
 
Scala: Simplifying Development
Scala: Simplifying DevelopmentScala: Simplifying Development
Scala: Simplifying Developmentmircodotta
 
Managing Binary Compatibility in Scala (Scala Lift Off 2011)
Managing Binary Compatibility in Scala (Scala Lift Off 2011)Managing Binary Compatibility in Scala (Scala Lift Off 2011)
Managing Binary Compatibility in Scala (Scala Lift Off 2011)mircodotta
 
Managing Binary Compatibility in Scala (Scala Days 2011)
Managing Binary Compatibility in Scala (Scala Days 2011)Managing Binary Compatibility in Scala (Scala Days 2011)
Managing Binary Compatibility in Scala (Scala Days 2011)mircodotta
 

More from mircodotta (10)

Scala Past, Present & Future
Scala Past, Present & FutureScala Past, Present & Future
Scala Past, Present & Future
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Right
 
Akka streams scala italy2015
Akka streams scala italy2015Akka streams scala italy2015
Akka streams scala italy2015
 
Akka streams
Akka streamsAkka streams
Akka streams
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
 
Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)
 
Scala: Simplifying Development
Scala: Simplifying DevelopmentScala: Simplifying Development
Scala: Simplifying Development
 
Managing Binary Compatibility in Scala (Scala Lift Off 2011)
Managing Binary Compatibility in Scala (Scala Lift Off 2011)Managing Binary Compatibility in Scala (Scala Lift Off 2011)
Managing Binary Compatibility in Scala (Scala Lift Off 2011)
 
Managing Binary Compatibility in Scala (Scala Days 2011)
Managing Binary Compatibility in Scala (Scala Days 2011)Managing Binary Compatibility in Scala (Scala Days 2011)
Managing Binary Compatibility in Scala (Scala Days 2011)
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Recently uploaded (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems (Soft-Shake 2014)

  • 1. Go Reactive Event-Driven, Scalable, Resilient & Responsive Systems Mirco Dotta @mircodotta
  • 2. The Four Reactive Traits Reactive Applications 2 http://reactivemanifesto.org/
  • 5. browser frontend server internal service storage internal service DB external service
  • 6. Responsiveness ! always available interactive (near) real-time
  • 8. Bounded Latency • fan-out in parallel and aggregate 6
  • 9. Bounded Latency • fan-out in parallel and aggregate 6 A B C
  • 10. Bounded Latency • fan-out in parallel and aggregate 6 A B C
  • 11. Bounded Latency • fan-out in parallel and aggregate 6 A B C e
  • 12. Bounded Latency • fan-out in parallel and aggregate • use circuit breakers for graceful degradation 7
  • 13. Bounded Latency • fan-out in parallel and aggregate • use circuit breakers for graceful degradation 7 do work fail fast
  • 14. Bounded Latency • fan-out in parallel and aggregate • use circuit breakers for graceful degradation • use bounded queues, measure flow rates 8
  • 15. Bounded Latency • fan-out in parallel and aggregate • use circuit breakers for graceful degradation • use bounded queues, measure flow rates 8 Use Bounded Queues: ! Latency = QueueLength • ProcessingTime ! (for reasonably stable average processing time)
  • 16. Bounded Latency • fan-out in parallel and aggregate • use circuit breakers for graceful degradation • use bounded queues, measure flow rates 8 Use Bounded Queues: ! Latency = QueueLength • ProcessingTime ! (for reasonably stable average processing time) m
  • 17. Resilience ! Responsive in the Face of Failure
  • 18. Handle Failure • software will fail • hardware will fail • humans will fail • system still needs to respond ➟ resilience 10
  • 20. Asynchronous Failure • parallel fan-out & distribution ➟ asynchronous execution • compartmentalization & isolation • no response? ➟ timeout events • someone else’s exception? ➟ supervision 12
  • 21. Asynchronous Failure • parallel fan-out & distribution ➟ asynchronous execution • compartmentalization & isolation • no response? ➟ timeout events • someone else’s exception? ➟ supervision 12
  • 22. Asynchronous Failure • parallel fan-out & distribution ➟ asynchronous execution • compartmentalization & isolation • no response? ➟ timeout events • someone else’s exception? ➟ supervision 12 Request Response Failure
  • 23. Asynchronous Failure • parallel fan-out & distribution ➟ asynchronous execution driven message-• compartmentalization & isolation • no response? ➟ timeout events • someone else’s exception? ➟ supervision 12 Request Response Failure
  • 24. Asynchronous Failure • parallel fan-out & distribution ➟ asynchronous execution • compartmentalization & isolation • no response? ➟ timeout events • someone else’s exception? ➟ supervision • location transparency ➟ seamless resilience 12
  • 25. Elasticity ! Responsive in the Face of Changing Load
  • 28. Handle Load • partition incoming work for distribution • share nothing • scale capacity up and down on demand • supervise and adapt • location transparency ➟ seamless scalability 14
  • 29. Handle Load • partition incoming work for distribution • share nothing • scale capacity up and down on demand • supervise and adapt • location transparency ➟ seamless scalability 14 m
  • 30. … this has some interesting consequences!
  • 31. Consequences • distribution & scalability ➟ loss of strong consistency • CAP theorem? — not as relevant as you think • eventual consistency ➟ gossip, heartbeats, dissemination of change ! 16
  • 32. Consequences • distribution & scalability ➟ loss of strong consistency • CAP theorem? — not as relevant as you think • eventual consistency ➟ gossip, heartbeats, dissemination of change ! 16 m
  • 33. Corollary • Reactive needs to be applied all the way down 17
  • 34. But what about us, the developers?
  • 35. Step 1: Take a Leap of Faith • thread-based models have made us defensive • “don’t let go of your thread!” • “asynchrony is suspicious” • “better return strict value, even if that needs blocking” 19
  • 36. Step 1: Take a Leap of Faith • thread-based models have made us defensive • “don’t let go of your thread!” • “asynchrony is suspicious” • “better return strict value, even if that needs blocking” • it is okay to write a method that returns a Future! 19
  • 37. Step 2: Rethink the Architecture • break out of the synchronous blocking prison • focus on communication & protocols • asynchronous program flow ➟ no step-through debugging ➟ tracing and monitoring • loose coupling 20
  • 38. Step 3: Profit! • clean business logic, separate from failure handling • distributable units of work • effortless parallelization 21
  • 39. Step 3: Profit! • clean business logic, separate from failure handling • distributable units of work • effortless parallelization • less assumptions ➟ lower maintenance cost 21
  • 41. The Four Reactive Traits Reactive Applications 23 http://reactivemanifesto.org/
  • 42. All credit for this great slidedeck goes to Roland Kuhn (@rolandkuhn), while any inaccuracy is mine. ©Typesafe 2014 – All Rights Reserved