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 Systems Event-Driven Scalable Resilient Responsive

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 Systems Event-Driven Scalable Resilient Responsive (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

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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"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
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
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
 

Recently uploaded (20)

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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"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
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
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
 

Go Reactive Systems Event-Driven Scalable Resilient Responsive

  • 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