How To Stay Responsive With 400 Backends

HOW TO STAY
RESPONSIVE WITH 400
BACKENDS
@mthmuldersmaartenm@infosupport.com
 
 
 
So, we need something that is...
 
Mobile First
Scalable
Secure
 
... but ...
 
doesn't store insurance data
retrieves that in real-time
from ~ 400 different companies!
 
 
START AS SIMPLE AS POSSIBLE
All problems in computer science can be
solved by another abstraction layer.
-- not David Wheeler (1927 - 2004)
JUST MOVE THE PROBLEM AWAY
Main Systems
Routing Engine
Insurer 01 Insurer 02 Insurer 03   ....    Insurer nn
FIRE UP YOUR IDE & START CODING
Standardized interface for retrieving insurance data.
One endpoint address for each insurance company.
Retrieve data using link code that includes insurer ID.
 
Shouldn't be too hard!
 
 
YES, IT BREAKS...
NOT RELATED, BUT
ANALYSIS
Blocking network calls
No time-outs
 
The whole JVM is waiting!
 
If an insurer is down, it will still be contacted.
This will slow down the system even further.
THE REACTIVE MANIFESTO
 
MESSAGE DRIVEN
Reactive Systems rely on asynchronous
message-passing to establish a boundary
between components that ensures loose
coupling, isolation and location
transparency.
ELASTIC
The system stays responsive under varying
workload. Reactive Systems can react to
changes in the input rate by increasing or
decreasing the resources allocated to
service these inputs.
RESILIENT
The system stays responsive in the face of
failure. Failures are contained within each
component, [...] thereby ensuring that
parts of the system can fail and recover
without compromising the system as a
whole.
RESPONSIVE
The system responds in a timely manner if
at all possible. Responsiveness is the
cornerstone of usability and utility [...].
Responsive systems focus on providing
rapid and consistent response times [...].
MEET... THE ACTOR MODEL
 
 
THE CIRCUIT BREAKER
GIMME TEH CODEZ!
INITIATE RETRIEVAL WITH TIME-OUT
val actor = context.actorOf(
ConsultInsurersActor.props(), s"consult-$berrfnr" )
actor ! RetrieveAllPolicyData(linkingCode)
context.system.scheduler.scheduleOnce(2 seconds) {
self ! RetrievalTimeout(berrfnr, linkingCodes)
}
CONSULT ONE INSURER
// Send the request
val request = HttpRequest(POST, Uri(url), Nil, entity)
http ? request
 
// Receive the response
response.entity.as[ResponseData] match {
case Left(failure) => client ! Failure(failure)
case Right(data) => client ! PolicyDataRetrieved(data)
}
CONSULT INSURER (WITH CIRCUIT BREAKER)
val cb = new CircuitBreaker(system.scheduler,
maxFailures = 5,
callTimeout = 5 seconds,
resetTimeout = 1 minute) // or obtain from config
// Send the request
val request = HttpRequest(POST, Uri(url), Nil, entity)
cb.withCircuitBreaker(http ? request) pipeTo self
 
 
 
 
KEY TAKEAWAYS
Actor model enables building resilient solutions
Suitable for large portions of concurrent work
Think outside the box
Use a whiteboard
GRACIAS
¿PREGUNTAS?
IMAGE ATTRIBUTIONS
Insurance Policy by .
"Success Kid" a.k.a Sammy Griner by .
Blendtec founder/owner Tom Dickson by .
Reactive Manifesto by .
Actor Model by .
Pictures of Money (Flickr)
Laney Griner (Flickr)
Tim Provost
Wiljag Denekamp
Wiljag Denekamp
1 of 35

More Related Content

Similar to How To Stay Responsive With 400 Backends(20)

Issa 042711Issa 042711
Issa 042711
Erin Banks742 views
SOC and SIEM.pptxSOC and SIEM.pptx
SOC and SIEM.pptx
SandeshUprety41K views
J0704055058J0704055058
J0704055058
IJERD Editor592 views
IBM Security Immune SystemIBM Security Immune System
IBM Security Immune System
Juan Pablo Coelho1.7K views
SEIM-Microsoft Sentinel.pptxSEIM-Microsoft Sentinel.pptx
SEIM-Microsoft Sentinel.pptx
AmrMousa51370 views
Unix Pos420 UopUnix Pos420 Uop
Unix Pos420 Uop
Jennifer Baker3 views

More from Maarten Mulders(20)

What's cooking in Maven? (Devoxx FR)What's cooking in Maven? (Devoxx FR)
What's cooking in Maven? (Devoxx FR)
Maarten Mulders173 views
Making Maven Marvellous (Devnexus)Making Maven Marvellous (Devnexus)
Making Maven Marvellous (Devnexus)
Maarten Mulders149 views
Making Maven Marvellous (Java.il)Making Maven Marvellous (Java.il)
Making Maven Marvellous (Java.il)
Maarten Mulders146 views
Making Maven Marvellous (JavaZone)Making Maven Marvellous (JavaZone)
Making Maven Marvellous (JavaZone)
Maarten Mulders90 views
SSL/TLS for Mortals (Devoxx UK)SSL/TLS for Mortals (Devoxx UK)
SSL/TLS for Mortals (Devoxx UK)
Maarten Mulders70 views
React in 40 minutes (JCON) React in 40 minutes (JCON)
React in 40 minutes (JCON)
Maarten Mulders105 views
 React in 50 Minutes (JNation)  React in 50 Minutes (JNation)
React in 50 Minutes (JNation)
Maarten Mulders143 views
SSL/TLS for Mortals (JavaLand) SSL/TLS for Mortals (JavaLand)
SSL/TLS for Mortals (JavaLand)
Maarten Mulders58 views
Making Maven Marvellous (J-Fall)Making Maven Marvellous (J-Fall)
Making Maven Marvellous (J-Fall)
Maarten Mulders91 views
SSL/TLS for Mortals (UtrechtJUG)SSL/TLS for Mortals (UtrechtJUG)
SSL/TLS for Mortals (UtrechtJUG)
Maarten Mulders202 views
SSL/TLS for Mortals (Lockdown Lecture)SSL/TLS for Mortals (Lockdown Lecture)
SSL/TLS for Mortals (Lockdown Lecture)
Maarten Mulders122 views
React in 50 Minutes (OpenValue) React in 50 Minutes (OpenValue)
React in 50 Minutes (OpenValue)
Maarten Mulders162 views
React in 50 Minutes (DevNexus) React in 50 Minutes (DevNexus)
React in 50 Minutes (DevNexus)
Maarten Mulders114 views

Recently uploaded(20)

Winter '24 Release Chat.pdfWinter '24 Release Chat.pdf
Winter '24 Release Chat.pdf
melbourneauuser9 views
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo Possible
Neo4j28 views
Embedded RustEmbedded Rust
Embedded Rust
Jens Siebert519 views
Why Cloud Services.pdfWhy Cloud Services.pdf
Why Cloud Services.pdf
Pi DATACENTERS6 views
ict act 1.pptxict act 1.pptx
ict act 1.pptx
sanjaniarun0812 views
Headless JS UG Presentation.pptxHeadless JS UG Presentation.pptx
Headless JS UG Presentation.pptx
Jack Spektor5 views

How To Stay Responsive With 400 Backends

  • 1. HOW TO STAY RESPONSIVE WITH 400 BACKENDS @mthmuldersmaartenm@infosupport.com
  • 2.  
  • 3.  
  • 4.  
  • 5. So, we need something that is...   Mobile First Scalable Secure   ... but ...   doesn't store insurance data retrieves that in real-time from ~ 400 different companies!
  • 6.  
  • 7.  
  • 8. START AS SIMPLE AS POSSIBLE
  • 9. All problems in computer science can be solved by another abstraction layer. -- not David Wheeler (1927 - 2004)
  • 10. JUST MOVE THE PROBLEM AWAY Main Systems Routing Engine Insurer 01 Insurer 02 Insurer 03   ....    Insurer nn
  • 11. FIRE UP YOUR IDE & START CODING Standardized interface for retrieving insurance data. One endpoint address for each insurance company. Retrieve data using link code that includes insurer ID.   Shouldn't be too hard!
  • 12.  
  • 13.  
  • 15. NOT RELATED, BUT ANALYSIS Blocking network calls No time-outs   The whole JVM is waiting!   If an insurer is down, it will still be contacted. This will slow down the system even further.
  • 17.  
  • 18. MESSAGE DRIVEN Reactive Systems rely on asynchronous message-passing to establish a boundary between components that ensures loose coupling, isolation and location transparency.
  • 19. ELASTIC The system stays responsive under varying workload. Reactive Systems can react to changes in the input rate by increasing or decreasing the resources allocated to service these inputs.
  • 20. RESILIENT The system stays responsive in the face of failure. Failures are contained within each component, [...] thereby ensuring that parts of the system can fail and recover without compromising the system as a whole.
  • 21. RESPONSIVE The system responds in a timely manner if at all possible. Responsiveness is the cornerstone of usability and utility [...]. Responsive systems focus on providing rapid and consistent response times [...].
  • 23.  
  • 24.  
  • 27. INITIATE RETRIEVAL WITH TIME-OUT val actor = context.actorOf( ConsultInsurersActor.props(), s"consult-$berrfnr" ) actor ! RetrieveAllPolicyData(linkingCode) context.system.scheduler.scheduleOnce(2 seconds) { self ! RetrievalTimeout(berrfnr, linkingCodes) }
  • 28. CONSULT ONE INSURER // Send the request val request = HttpRequest(POST, Uri(url), Nil, entity) http ? request   // Receive the response response.entity.as[ResponseData] match { case Left(failure) => client ! Failure(failure) case Right(data) => client ! PolicyDataRetrieved(data) }
  • 29. CONSULT INSURER (WITH CIRCUIT BREAKER) val cb = new CircuitBreaker(system.scheduler, maxFailures = 5, callTimeout = 5 seconds, resetTimeout = 1 minute) // or obtain from config // Send the request val request = HttpRequest(POST, Uri(url), Nil, entity) cb.withCircuitBreaker(http ? request) pipeTo self
  • 30.  
  • 31.  
  • 32.  
  • 33.  
  • 34. KEY TAKEAWAYS Actor model enables building resilient solutions Suitable for large portions of concurrent work Think outside the box Use a whiteboard
  • 35. GRACIAS ¿PREGUNTAS? IMAGE ATTRIBUTIONS Insurance Policy by . "Success Kid" a.k.a Sammy Griner by . Blendtec founder/owner Tom Dickson by . Reactive Manifesto by . Actor Model by . Pictures of Money (Flickr) Laney Griner (Flickr) Tim Provost Wiljag Denekamp Wiljag Denekamp