Reactive Architecture
Reactive Architecture
What’s it all about?
2005
Hyundai Elantra looks like this…
Internet has 1 billion users
Facebook has 5.5 million users
Twitter doesn’t exist yet
MySpace is acquired for $850,000,000
Youtube is launched
2016
Hyundai Elantra looks like this…
Internet has 3.5 billion users
Facebook has 1.5 billion users
Twitter has 0.31 billion users
Youtube has 1.3 billion users
A SINGLE website may now handle as much
traffic as the ENTIRE (!) Internet did a decade
ago…
We need to change the
Paradigm!
Vehicle Fleet Tracker
Application Breakdown
Requirements
Track GPS Locations
Assign transits
Optimise routes
Monitor vehicle stats
Calculate costs
The Killer Feature:
Suggest speed and direction for:
Optimised fuel consumption
Optimised arrival speed
Optimise speed for ‘catching’ green lights
Presentation
Business Logic
Data Access
DB
Model
Multilayered Architecture (Old School)
Driver
Dispatcher
–Everett Dirksen
“A billion here, a billion there, and pretty soon
you're talking about real money…”
We need to Scale up!
To make $$$
Alas, heavy loads pose
heavy issues…
We Need to:
1. Keep the system Responsive - especially at peaks
2. Make sure the system doesn’t crash and is Resilient
3. Avoid extreme costs during downtime - Flexible
Responsive
Rapid and consistent response times
Achieved through:
Resilience
Scalability (Flexibility)
A Message-Driven foundation
Asynchronous
Processing
The key is:
The Synchronous
Approach
Cut Salad - 5 min
Make Toast - 3 min
Boil eggs - 10 min
Eat
…Took 18 minutes
The Asynchronous
Approach
Boil Eggs - 10 min
Cut salad - 5 min
Make Toast - 3 min
Eat
…Took 10 minutes
We Achieve System-Wide Async via
Message Driven
Architecture
Message-Driven
Process
A
Process
B
Process
C
Message Driven
Vs.
Event Driven
Messages have a specific recipient
Events can have multiple handlers
Reactive Architecture
Enter:
Responsive
Message Driven
ResilientElastic/Scalable
Reactive Manifesto
Message-driven
Resiliency
Isolation
Location Transparency
Separate error channel
Message-driven
Scalability
Scale out on demand
No shared mutable state
No hardware limitation
Implementation using
Micro-Services
Micro Services
Message/Event driven
Resilient
Isolated and self contained
Clustered
Distributed
Elastic/Scalable
Implementation using
Actor Based Framework -
AKA AKKA
What’s an Actor
An actor is a construct with the following
properties:
- A mailbox for receiving messages
- The actor’s logic
- Isolated state
Summary
Traditional Monolithic applications with thread
based concurrency are:
Difficult to scale out
Not resilient
Prone to fail under stress
Reactive Architecture is a viable solution
Summary 2
The formula for Reactive Architecture is:
(Resilience + Elasticity) x Message-Driven = Responsive
Thank You
Assaf Gannon
assaf@tikalk.com

Reactive Architecture

Editor's Notes

  • #15 Knight Capital - 1/8/2012 - 440 million loss due to faulty software A penny saved is a penny earned