Upload
assaf-gannon
View
55
Download
0
Embed Size (px)
Citation preview
Reactive Architecture
Reactive ArchitectureWhat’s it all about?
2005
Hyundai Elantra looks like this…Internet has 1 billion usersFacebook has 5.5 million usersTwitter doesn’t exist yetMySpace is acquired for $850,000,000Youtube is launched
2016
Hyundai Elantra looks like this…Internet has 3.5 billion usersFacebook has 1.5 billion usersTwitter has 0.31 billion usersYoutube 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 TrackerApplication 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 DrivenArchitecture
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 ServicesMessage/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
SummaryTraditional 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