SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Reactieve applicaties
Klaar voor de toekomst
JFall 2013
Allard Buijze – allard.buijze@trifork.nl
Allard Buijze
Software Architect bij Trifork (Amsterdam)
Organsatoren van GOTO & QCON

15 jaar web development ervaring
Gelooft sterk in DDD en CQRS

Ontwikkelaar en initiatiefnemer van Axon Framework
Java Framework voor schaalbaarheid en performance
www.axonframework.org
Een kleine terugblik…
1990
0,3% van Nederland had internettoegang
0.001 PB / Maand data-transfer

2000
40% internettoegang
86 PB / Maand

2012
93% internettoegang
> 30 000 PB / Maand
Waarvan 885 PB / Maand mobiel
Layered architecture
In de jaren 70…

Bron: wikipedia.org
In de jaren 70…

Bron: vintagecomputer.net
Het web in 2013… en verder…
Het web in 2013… en verder…
Het web in 2013… en verder…
Niet meer alleen Google en Twitter…
Reactive
Merriam Webster: Readily responsive to a stimulus
De kwaliteiten van een reactieve applicatie

Responsive

Scalable

Reactive

EventDriven

Resilient
Responsive

Scalable

Reactive

EventDriven

Resilient
Normaal...

A
C

getState()

state

B
De “Event Driven” manier

A
D

C

event

E

pub-sub

event

B
Event Driven – Amdahl’s Law

The speedup of a program using multiple
processors in parallel computing is limited by
the sequential fraction of the program.
Procedural – Not parallelizable...
public void doMyBusinessLogic() {
doSomethingInternally();
externalComponent1.doSomethingRelated();
externalComponent2.doSomethingElse();
return someResult;
}
Procedural – Parallelizable, but ugly...
public void doMyBusinessLogic() {
doSomethingInternally();
threadPool.execute(new Runnable() { ...
externalComponent1.doSomethingRelated()});
threadPool.execute(new Runnable() { ...

externalComponent2.doSomethingElse()});
return someResult;
}
Parallelizable...
public void doMyBusinessLogic() {
doSomethingInternally();
eventPublisher.publish(aNotification());
return someResult;
}

public void handler(Notification n) {
doSomethingRelated();
}
Separation of concerns

Business
logica

C

Infrastructuur
- Locking
- Threading
- Netwerk / IO

event

pub-sub

Geen harde
No dependency
afhankelijkheden

Business
logica

event

B
De kwaliteiten van een reactieve applicatie

Responsive

Scalable

Reactive

EventDriven

Resilient
Scalable
Merriam Webster: “capable of being easily
expanded or upgraded on demand”
Elasticiteit
Location transparency

SomeServiceInterface service
= new RemoteService(...)
result = service.callSomeMethod();

Doet zich voor als lokale aanroep...
Location transparency – embrace the network

service.someMethod(someParameter, new Callback() {
public void onResult(Result result) {
// do stuff with result
}

public void onError(Exception e) {
// handle failure
}
});
Events – Inherently location transparent

D

C

event

E

pub-sub

event

B
De kwaliteiten van een reactieve applicatie

Responsive

Scalable

Reactive

EventDriven

Resilient
Resilient
Merriam Webster:
• the ability of a substance or object to spring back into shape
• the capacity to recover quickly from difficulties
Voorbeelden genoeg…

“Barclays Bank System Crashes” (2012)

“Lloyds' banking systems failure hits 22m retail customers” (2012)

“Failure of American Airlines reservations system grounds all flights” (2013)
Observeer componenten

D

C

event

pub-sub

event

!

E

!

B
Stability patterns
Bulkhead
Circuit breaker

Timeouts
Decoupling middleware
Handshaking
Test Harness
Let it crash!
Stability patterns – Bulkhead
Stability patterns – Bulkhead
Bulkhead in software

A
!

C

event

pub-sub

event

B
Bulkhead in software

A
C

event

pub-sub

event

B
Bulkhead in software

A
C

event

pub-sub

event

B
Circuitbreaker
Stability patterns – Circuitbreaker

A
C

checkStatus()

doSomething()

!

B
Stability patterns
Bulkhead
Circuit breaker

Timeouts
Decoupling middleware
Handshaking
Test Harness
Let it crash!
De kwaliteiten van een reactieve applicatie

Responsive

Scalable

Reactive

EventDriven

Resilient
Responsive
Merriam Webster: “quick to respond or
react appropriately"
Responsive is...
Responsive is...



Real-time



Engaging



Rich



Collaborative
Dus niet....
Dus wel...
Observable models...

subscribe()
notify()

Stateful Client

Server
Als we toch al events hebben...

pub-sub

Stateful Client

Server
# voorkomens 

# voorkomens 

Latency....

latency 

latency 
Capacity planning – Hoe groot moet een queue zijn?
Zo “kort” mogelijk?

Lekker “lang”?

Onbeperkt?

Reken het uit, of meet het!
Pn

n

(1

)

Wq

Ws

1
# requests 

Capacity planning

Tijd 
De kwaliteiten van een reactieve applicatie

Responsive

Scalable

Reactive

EventDriven

Resilient
En hoe?
Tools en hulpmiddelen voor Reactive Applications
Tools en Frameworks
Akka

– Actor Model

Axon Framework

– CQRS / EDA

Spring Reactor

– Async message processing

WebSockets (JSR-356)

– Full duplex communicatie over http(s)

Lambda Expressions
Method references

– Voorkom “callback hell”
Latency

Responsive

Axon Framework

Event Driven

Resilience

Location transparency
Actor model

Capacity planning

Queues

Event Driven Architecture
Collaborative

Embrace the network
Stability patterns

Amdahl

Real-time
Akka

Engaging

Circuit breaker
Back pressure

Asynchronous

Responsive
Lambda’s

Bulkhead pattern

WebSockets
Little’s Law
Spring Reactor
reactivemanifesto.org
Vragen?
Meer informatie: www.reactivemanifesto.org
www.axonframework.org
allard.buijze@trifork.nl

Weitere ähnliche Inhalte

Ähnlich wie Reactieve applicaties; klaar voor de toekomst

Het Gellijk van De Duurzame Website
Het Gellijk van De Duurzame WebsiteHet Gellijk van De Duurzame Website
Het Gellijk van De Duurzame WebsiteEric van Hall
 
Informatiebeveiliging & Web 2.0
Informatiebeveiliging & Web 2.0Informatiebeveiliging & Web 2.0
Informatiebeveiliging & Web 2.0Virtualbits
 
BIMserver introductie
BIMserver introductieBIMserver introductie
BIMserver introductieLéon Berlo
 
Product risico analyse in de praktijk (2010) - Kees Blokland
Product risico analyse in de praktijk (2010) - Kees BloklandProduct risico analyse in de praktijk (2010) - Kees Blokland
Product risico analyse in de praktijk (2010) - Kees BloklandKees Blokland
 
Kennismaking Suneco algemeen
Kennismaking Suneco algemeenKennismaking Suneco algemeen
Kennismaking Suneco algemeensuneco_nl
 
Scaling up Scrum met TFS 2013
Scaling up Scrum met TFS 2013Scaling up Scrum met TFS 2013
Scaling up Scrum met TFS 2013Delta-N
 
Responsive webdesign
Responsive webdesignResponsive webdesign
Responsive webdesignSybren Wartna
 
BIMserver.org op ICT delta 2010
BIMserver.org op ICT delta 2010BIMserver.org op ICT delta 2010
BIMserver.org op ICT delta 2010Léon Berlo
 
Nobel Cloud Services
Nobel Cloud ServicesNobel Cloud Services
Nobel Cloud ServicesPiet van Vugt
 
Crowd Designing Microservices Architecture
Crowd Designing Microservices ArchitectureCrowd Designing Microservices Architecture
Crowd Designing Microservices ArchitectureRubiX BV
 
Workshop BI/DWH AGILE TESTING Zwitserleven Dutch
Workshop BI/DWH AGILE TESTING Zwitserleven DutchWorkshop BI/DWH AGILE TESTING Zwitserleven Dutch
Workshop BI/DWH AGILE TESTING Zwitserleven DutchMarcus Drost
 
Lac 2013 hogere klanttevredenheid met dev ops-ready architectuur
Lac 2013   hogere klanttevredenheid met dev ops-ready architectuurLac 2013   hogere klanttevredenheid met dev ops-ready architectuur
Lac 2013 hogere klanttevredenheid met dev ops-ready architectuurRaimond Brookman
 
Waarom 42windmills
Waarom 42windmillsWaarom 42windmills
Waarom 42windmills42windmills
 
Mechatronic System Design
Mechatronic System DesignMechatronic System Design
Mechatronic System DesignVincent Claes
 
Cloud: Frisse lucht of gebakken lucht ?
Cloud: Frisse lucht of gebakken lucht ?Cloud: Frisse lucht of gebakken lucht ?
Cloud: Frisse lucht of gebakken lucht ?B.A.
 
Risicomanagement op projecten vanuit template omgeving public
Risicomanagement op projecten vanuit template omgeving publicRisicomanagement op projecten vanuit template omgeving public
Risicomanagement op projecten vanuit template omgeving publicRelatics
 
2008-06-23 - SDN - Kwaliteit van software, wat is dat nu eigenlijk?
2008-06-23 - SDN - Kwaliteit van software, wat is dat nu eigenlijk?2008-06-23 - SDN - Kwaliteit van software, wat is dat nu eigenlijk?
2008-06-23 - SDN - Kwaliteit van software, wat is dat nu eigenlijk?Jaap van Ekris
 

Ähnlich wie Reactieve applicaties; klaar voor de toekomst (20)

Het Gellijk van De Duurzame Website
Het Gellijk van De Duurzame WebsiteHet Gellijk van De Duurzame Website
Het Gellijk van De Duurzame Website
 
Informatiebeveiliging & Web 2.0
Informatiebeveiliging & Web 2.0Informatiebeveiliging & Web 2.0
Informatiebeveiliging & Web 2.0
 
BIMserver introductie
BIMserver introductieBIMserver introductie
BIMserver introductie
 
Product risico analyse in de praktijk (2010) - Kees Blokland
Product risico analyse in de praktijk (2010) - Kees BloklandProduct risico analyse in de praktijk (2010) - Kees Blokland
Product risico analyse in de praktijk (2010) - Kees Blokland
 
SGS Skybase (NL) .pdf
SGS Skybase (NL) .pdfSGS Skybase (NL) .pdf
SGS Skybase (NL) .pdf
 
Kennismaking Suneco algemeen
Kennismaking Suneco algemeenKennismaking Suneco algemeen
Kennismaking Suneco algemeen
 
Scaling up Scrum met TFS 2013
Scaling up Scrum met TFS 2013Scaling up Scrum met TFS 2013
Scaling up Scrum met TFS 2013
 
Responsive webdesign
Responsive webdesignResponsive webdesign
Responsive webdesign
 
BIMserver.org op ICT delta 2010
BIMserver.org op ICT delta 2010BIMserver.org op ICT delta 2010
BIMserver.org op ICT delta 2010
 
Tiende Meetup: Microservices
Tiende Meetup: MicroservicesTiende Meetup: Microservices
Tiende Meetup: Microservices
 
Nobel Cloud Services
Nobel Cloud ServicesNobel Cloud Services
Nobel Cloud Services
 
Crowd Designing Microservices Architecture
Crowd Designing Microservices ArchitectureCrowd Designing Microservices Architecture
Crowd Designing Microservices Architecture
 
Workshop BI/DWH AGILE TESTING Zwitserleven Dutch
Workshop BI/DWH AGILE TESTING Zwitserleven DutchWorkshop BI/DWH AGILE TESTING Zwitserleven Dutch
Workshop BI/DWH AGILE TESTING Zwitserleven Dutch
 
Lac 2013 hogere klanttevredenheid met dev ops-ready architectuur
Lac 2013   hogere klanttevredenheid met dev ops-ready architectuurLac 2013   hogere klanttevredenheid met dev ops-ready architectuur
Lac 2013 hogere klanttevredenheid met dev ops-ready architectuur
 
Waarom 42windmills
Waarom 42windmillsWaarom 42windmills
Waarom 42windmills
 
Mechatronic System Design
Mechatronic System DesignMechatronic System Design
Mechatronic System Design
 
Cloud computing lunchsessie (v2)
Cloud computing lunchsessie (v2)Cloud computing lunchsessie (v2)
Cloud computing lunchsessie (v2)
 
Cloud: Frisse lucht of gebakken lucht ?
Cloud: Frisse lucht of gebakken lucht ?Cloud: Frisse lucht of gebakken lucht ?
Cloud: Frisse lucht of gebakken lucht ?
 
Risicomanagement op projecten vanuit template omgeving public
Risicomanagement op projecten vanuit template omgeving publicRisicomanagement op projecten vanuit template omgeving public
Risicomanagement op projecten vanuit template omgeving public
 
2008-06-23 - SDN - Kwaliteit van software, wat is dat nu eigenlijk?
2008-06-23 - SDN - Kwaliteit van software, wat is dat nu eigenlijk?2008-06-23 - SDN - Kwaliteit van software, wat is dat nu eigenlijk?
2008-06-23 - SDN - Kwaliteit van software, wat is dat nu eigenlijk?
 

Mehr von NLJUG

The future of Web-Scale - Johan Tillema, Rene Boere & Chris Quach
The future of Web-Scale - Johan Tillema, Rene Boere & Chris QuachThe future of Web-Scale - Johan Tillema, Rene Boere & Chris Quach
The future of Web-Scale - Johan Tillema, Rene Boere & Chris QuachNLJUG
 
Speedy perception trumps speedy reception–smart asynchronous interactions - L...
Speedy perception trumps speedy reception–smart asynchronous interactions - L...Speedy perception trumps speedy reception–smart asynchronous interactions - L...
Speedy perception trumps speedy reception–smart asynchronous interactions - L...NLJUG
 
Decoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan SchrijverDecoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan SchrijverNLJUG
 
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter DanesUsing Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter DanesNLJUG
 
Kill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnKill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnNLJUG
 
Real-time user interfaces - sosm gewoon makkelijker - Allard Buijze
Real-time user interfaces - sosm gewoon makkelijker - Allard BuijzeReal-time user interfaces - sosm gewoon makkelijker - Allard Buijze
Real-time user interfaces - sosm gewoon makkelijker - Allard BuijzeNLJUG
 
The end of traditional enterprise IT - ING's journey to the next generation I...
The end of traditional enterprise IT - ING's journey to the next generation I...The end of traditional enterprise IT - ING's journey to the next generation I...
The end of traditional enterprise IT - ING's journey to the next generation I...NLJUG
 
Performance van Java 8 en verder - Jeroen Borgers
Performance van Java 8 en verder - Jeroen BorgersPerformance van Java 8 en verder - Jeroen Borgers
Performance van Java 8 en verder - Jeroen BorgersNLJUG
 
Introduction to Reactive with Play and Akka - Markus Jura
Introduction to Reactive with Play and Akka - Markus JuraIntroduction to Reactive with Play and Akka - Markus Jura
Introduction to Reactive with Play and Akka - Markus JuraNLJUG
 
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...NLJUG
 
Workshop angular dart presentatie - Atos
Workshop angular dart presentatie - AtosWorkshop angular dart presentatie - Atos
Workshop angular dart presentatie - AtosNLJUG
 
Workshop spring boot presentatie - Atos
Workshop spring boot presentatie - AtosWorkshop spring boot presentatie - Atos
Workshop spring boot presentatie - AtosNLJUG
 
Cultivating the jenkins job jungle with groovy - Patrick van Dissel
Cultivating the jenkins job jungle with groovy - Patrick van DisselCultivating the jenkins job jungle with groovy - Patrick van Dissel
Cultivating the jenkins job jungle with groovy - Patrick van DisselNLJUG
 
Rethink your architecture - Marten Deinum
Rethink your architecture - Marten DeinumRethink your architecture - Marten Deinum
Rethink your architecture - Marten DeinumNLJUG
 
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopper
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopperEvolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopper
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopperNLJUG
 
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...NLJUG
 
Apache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn DashorstApache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn DashorstNLJUG
 
Opening - Bert Ertman
Opening - Bert ErtmanOpening - Bert Ertman
Opening - Bert ErtmanNLJUG
 
Returning the right results - Jettro Coenradie
Returning the right results - Jettro CoenradieReturning the right results - Jettro Coenradie
Returning the right results - Jettro CoenradieNLJUG
 
Reactive programming met Java 8 en Java EE 7 - Martijn Blankestijn
Reactive programming met Java 8 en Java EE 7 - Martijn BlankestijnReactive programming met Java 8 en Java EE 7 - Martijn Blankestijn
Reactive programming met Java 8 en Java EE 7 - Martijn BlankestijnNLJUG
 

Mehr von NLJUG (20)

The future of Web-Scale - Johan Tillema, Rene Boere & Chris Quach
The future of Web-Scale - Johan Tillema, Rene Boere & Chris QuachThe future of Web-Scale - Johan Tillema, Rene Boere & Chris Quach
The future of Web-Scale - Johan Tillema, Rene Boere & Chris Quach
 
Speedy perception trumps speedy reception–smart asynchronous interactions - L...
Speedy perception trumps speedy reception–smart asynchronous interactions - L...Speedy perception trumps speedy reception–smart asynchronous interactions - L...
Speedy perception trumps speedy reception–smart asynchronous interactions - L...
 
Decoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan SchrijverDecoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
Decoding the airspace above you with Java and $7 hardware - Bert Jan Schrijver
 
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter DanesUsing Docker to Develop, Test and Run Maven Projects - Wouter Danes
Using Docker to Develop, Test and Run Maven Projects - Wouter Danes
 
Kill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnKill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van Rijn
 
Real-time user interfaces - sosm gewoon makkelijker - Allard Buijze
Real-time user interfaces - sosm gewoon makkelijker - Allard BuijzeReal-time user interfaces - sosm gewoon makkelijker - Allard Buijze
Real-time user interfaces - sosm gewoon makkelijker - Allard Buijze
 
The end of traditional enterprise IT - ING's journey to the next generation I...
The end of traditional enterprise IT - ING's journey to the next generation I...The end of traditional enterprise IT - ING's journey to the next generation I...
The end of traditional enterprise IT - ING's journey to the next generation I...
 
Performance van Java 8 en verder - Jeroen Borgers
Performance van Java 8 en verder - Jeroen BorgersPerformance van Java 8 en verder - Jeroen Borgers
Performance van Java 8 en verder - Jeroen Borgers
 
Introduction to Reactive with Play and Akka - Markus Jura
Introduction to Reactive with Play and Akka - Markus JuraIntroduction to Reactive with Play and Akka - Markus Jura
Introduction to Reactive with Play and Akka - Markus Jura
 
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...
Web-scale op basis van Hadoop en Akka Reactive Streams - Johan Tillema, Rene ...
 
Workshop angular dart presentatie - Atos
Workshop angular dart presentatie - AtosWorkshop angular dart presentatie - Atos
Workshop angular dart presentatie - Atos
 
Workshop spring boot presentatie - Atos
Workshop spring boot presentatie - AtosWorkshop spring boot presentatie - Atos
Workshop spring boot presentatie - Atos
 
Cultivating the jenkins job jungle with groovy - Patrick van Dissel
Cultivating the jenkins job jungle with groovy - Patrick van DisselCultivating the jenkins job jungle with groovy - Patrick van Dissel
Cultivating the jenkins job jungle with groovy - Patrick van Dissel
 
Rethink your architecture - Marten Deinum
Rethink your architecture - Marten DeinumRethink your architecture - Marten Deinum
Rethink your architecture - Marten Deinum
 
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopper
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopperEvolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopper
Evolutionary Algorithms: the key to solving complex Java puzzles! - Bas knopper
 
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
Modularity and Domain Driven Design; a killer Combination? - Tom de Wolf & St...
 
Apache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn DashorstApache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn Dashorst
 
Opening - Bert Ertman
Opening - Bert ErtmanOpening - Bert Ertman
Opening - Bert Ertman
 
Returning the right results - Jettro Coenradie
Returning the right results - Jettro CoenradieReturning the right results - Jettro Coenradie
Returning the right results - Jettro Coenradie
 
Reactive programming met Java 8 en Java EE 7 - Martijn Blankestijn
Reactive programming met Java 8 en Java EE 7 - Martijn BlankestijnReactive programming met Java 8 en Java EE 7 - Martijn Blankestijn
Reactive programming met Java 8 en Java EE 7 - Martijn Blankestijn
 

Reactieve applicaties; klaar voor de toekomst

Hinweis der Redaktion

  1. low-level primitives (locking, threading) are part of infrastructureApplication code doesn’t expose “real infrastructure”Loose coupling between components