SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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)
 

Kürzlich hochgeladen

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

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