go reactive: building responsive, resilient, elastic & message-driven systems
TRANSCRIPT
![Page 1: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/1.jpg)
Jonas Bonér CTO Typesafe
@jboner
Go ReactiveBuilding Responsive, Resilient,
Elastic & Message-Driven Systems
![Page 2: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/2.jpg)
![Page 3: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/3.jpg)
The rules of the game
have changed
![Page 4: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/4.jpg)
3
Yesterday Today
![Page 5: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/5.jpg)
3
Yesterday Today
Single machines Clusters of machines
![Page 6: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/6.jpg)
3
Yesterday Today
Single machines Clusters of machines
Single core processors Multicore processors
![Page 7: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/7.jpg)
3
Yesterday Today
Single machines Clusters of machines
Single core processors Multicore processors
Expensive RAM Cheap RAM
![Page 8: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/8.jpg)
3
Yesterday Today
Single machines Clusters of machines
Single core processors Multicore processors
Expensive RAM Cheap RAM
Expensive disk Cheap disk
![Page 9: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/9.jpg)
3
Yesterday Today
Single machines Clusters of machines
Single core processors Multicore processors
Expensive RAM Cheap RAM
Expensive disk Cheap disk
Slow networks Fast networks
![Page 10: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/10.jpg)
3
Yesterday Today
Single machines Clusters of machines
Single core processors Multicore processors
Expensive RAM Cheap RAM
Expensive disk Cheap disk
Slow networks Fast networks
Few concurrent users Lots of concurrent users
![Page 11: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/11.jpg)
3
Yesterday Today
Single machines Clusters of machines
Single core processors Multicore processors
Expensive RAM Cheap RAM
Expensive disk Cheap disk
Slow networks Fast networks
Few concurrent users Lots of concurrent users
Small data sets Large data sets
![Page 12: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/12.jpg)
3
Yesterday Today
Single machines Clusters of machines
Single core processors Multicore processors
Expensive RAM Cheap RAM
Expensive disk Cheap disk
Slow networks Fast networks
Few concurrent users Lots of concurrent users
Small data sets Large data sets
Latency in seconds Latency in milliseconds
![Page 13: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/13.jpg)
![Page 14: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/14.jpg)
Reactive “Readily responsive to a stimulus”
- Merriam Webster
![Page 15: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/15.jpg)
Reactive Applications
The Principles of Reactive Systems
6
![Page 16: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/16.jpg)
![Page 18: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/18.jpg)
Responsive “Quick to respond or react appropriately”
- Merriam Webster
![Page 19: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/19.jpg)
9
The system should always be responsive
![Page 20: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/20.jpg)
9
1. Blue skies2. Heavy load3. Failures
The system should always be responsive
![Page 21: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/21.jpg)
Resilient “The ability of a substance or object to spring back into shape”
“The capacity to recover quickly from difficulties” - Merriam Webster
![Page 22: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/22.jpg)
Think Vending Machine
![Page 23: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/23.jpg)
Coffee Machine
Programmer
Think Vending Machine
![Page 24: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/24.jpg)
Coffee Machine
Programmer
Inserts coins
Think Vending Machine
![Page 25: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/25.jpg)
Coffee Machine
Programmer
Inserts coins
Add more coins
Think Vending Machine
![Page 26: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/26.jpg)
Coffee Machine
Programmer
Inserts coins
Gets coffee
Add more coins
Think Vending Machine
![Page 27: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/27.jpg)
Coffee Machine
Programmer
Think Vending Machine
![Page 28: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/28.jpg)
Coffee Machine
Programmer
Inserts coins
Think Vending Machine
![Page 29: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/29.jpg)
Coffee Machine
Programmer
Inserts coins
Think Vending Machine
Out of coffee beans error
![Page 30: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/30.jpg)
Coffee Machine
Programmer
Inserts coins
Think Vending Machine
Out of coffee beans error
WRONG
![Page 31: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/31.jpg)
Coffee Machine
Programmer
Inserts coins
Think Vending Machine
![Page 32: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/32.jpg)
Coffee Machine
Programmer
Inserts coins
Out of coffee beans
failure
Think Vending Machine
![Page 33: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/33.jpg)
Coffee Machine
Programmer
Service Guy
Inserts coins
Out of coffee beans
failure
Think Vending Machine
![Page 34: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/34.jpg)
Coffee Machine
Programmer
Service Guy
Inserts coins
Out of coffee beans
failure
Adds more beans
Think Vending Machine
![Page 35: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/35.jpg)
Coffee Machine
Programmer
Service Guy
Inserts coins
Gets coffee
Out of coffee beans
failure
Adds more beans
Think Vending Machine
![Page 36: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/36.jpg)
The Right Way
ServiceClient
![Page 37: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/37.jpg)
The Right Way
ServiceClient
Request
![Page 38: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/38.jpg)
The Right Way
ServiceClient
Request
Response
![Page 39: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/39.jpg)
The Right Way
ServiceClient
Request
Response
Validation Error
![Page 40: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/40.jpg)
The Right Way
ServiceClient
Request
Response
Validation Error
Application Failure
![Page 41: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/41.jpg)
The Right Way
ServiceClient
Supervisor
Request
Response
Validation Error
Application Failure
![Page 42: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/42.jpg)
The Right Way
ServiceClient
Supervisor
Request
Response
Validation Error
Application Failure
Manages Failure
![Page 43: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/43.jpg)
![Page 44: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/44.jpg)
Resilience IsBy Design
![Page 45: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/45.jpg)
![Page 46: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/46.jpg)
1. Isolate the failure
2. Compartmentalize
3. Manage failure locally
4. Avoid cascading failures
Use Bulkheads
![Page 47: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/47.jpg)
1. Isolate the failure
2. Compartmentalize
3. Manage failure locally
4. Avoid cascading failures
Use Bulkheads
![Page 48: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/48.jpg)
Enter Supervision
![Page 49: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/49.jpg)
A
B
BarFoo
C
BE
A
D
C
Automatic and mandatory supervisionSupervisor hierarchies
![Page 50: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/50.jpg)
A
B
BarFoo
C
E
A
D
C
Automatic and mandatory supervisionSupervisor hierarchies
B
![Page 51: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/51.jpg)
19
Every single actor has a default supervisor strategy. Which is usually sufficient. But it can be overridden.
Supervision in Akka
![Page 52: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/52.jpg)
19
class Supervisor extends AbstractActor { private SupervisorStrategy strategy = new OneForOneStrategy( 10, Duration.create(1, TimeUnit.MINUTES), DirectiveBuilder. match(ArithmeticException.class, e -> resume()). match(NullPointerException.class, e -> restart()). matchAny( e -> escalate()). build()); … // rest of actor omitted
} }
Supervision in Akka
![Page 53: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/53.jpg)
![Page 54: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/54.jpg)
Resilience requires aMessage-DrivenArchitecture
![Page 55: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/55.jpg)
Elastic “Capable of ready change or easy expansion or contraction”
- Merriam Webster
![Page 56: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/56.jpg)
UPScale
![Page 57: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/57.jpg)
UPScale
and down
![Page 58: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/58.jpg)
1. Minimize Contention 2. Maximize Locality of Reference
23
We need to
![Page 59: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/59.jpg)
Common points of
24
ApplicationPhysical
contention
![Page 60: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/60.jpg)
25
GO
![Page 61: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/61.jpg)
Async
25
GO
![Page 62: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/62.jpg)
26
Neverever
![Page 63: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/63.jpg)
26
Neverever
![Page 64: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/64.jpg)
Block
26
Neverever
![Page 65: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/65.jpg)
27
NOTHINGshare
![Page 66: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/66.jpg)
28
Needs to be async and non-blocking all the way down…
![Page 67: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/67.jpg)
28
Needs to be async and non-blocking all the way down…
![Page 68: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/68.jpg)
29
Single Writer Principle
![Page 69: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/69.jpg)
29
Single Writer PrincipleIO deviceProducers
SERIAL & CONTENDED
![Page 70: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/70.jpg)
29
Single Writer PrincipleIO deviceProducers
SERIAL & CONTENDED
IO deviceProducers Actor or Queue
BATCHED & UNCONTENDED
![Page 71: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/71.jpg)
The Role of Immutable State
30
![Page 72: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/72.jpg)
The Role of Immutable State
30
![Page 73: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/73.jpg)
The Role of Immutable State• Great to represent facts • Messages and Events
• Database snapshots
• Representing the succession of time
30
![Page 74: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/74.jpg)
The Role of Immutable State• Great to represent facts • Messages and Events
• Database snapshots
• Representing the succession of time
• Mutable State is ok if local and contained • Allows Single-threaded processing
• Allows single writer principle
• Feels more natural
• Publish the results to the world as Immutable State
30
![Page 75: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/75.jpg)
Divide & Conquer
31
![Page 76: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/76.jpg)
32
Pipelining
![Page 77: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/77.jpg)
ON DEMAND
33
scale
![Page 78: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/78.jpg)
OUTScale
![Page 79: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/79.jpg)
OUTScale
and in
![Page 80: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/80.jpg)
• Mobile
• Cloud Services, REST etc.
• NOSQL DBs
• Big Data
35
Distributed Computing is the
new normal
![Page 81: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/81.jpg)
What is the essence of distributed systems?
36
![Page 82: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/82.jpg)
What is the essence of distributed systems?
To try to overcome that1. Information travels at the speed of light
2. Independent things fail independently
36
![Page 83: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/83.jpg)
Slow node
Dead node
No difference
37
and a
Between a
![Page 84: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/84.jpg)
The network is
38
![Page 85: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/85.jpg)
The network is
38
http://aphyr.com/posts/288-the-network-is-reliable
Inherently Unreliable
![Page 86: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/86.jpg)
39
Graveyard of distributed systems
![Page 87: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/87.jpg)
39
Graveyard of distributed systems• Distributed Shared Mutable State
• EVIL (where N is number of nodes)N
![Page 88: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/88.jpg)
39
Graveyard of distributed systems• Distributed Shared Mutable State
• EVIL (where N is number of nodes)N
• Serializable Distributed Transactions
![Page 89: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/89.jpg)
39
Graveyard of distributed systems• Distributed Shared Mutable State
• EVIL (where N is number of nodes)N
• Serializable Distributed Transactions
• Synchronous RPC
![Page 90: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/90.jpg)
39
Graveyard of distributed systems• Distributed Shared Mutable State
• EVIL (where N is number of nodes)N
• Serializable Distributed Transactions
• Synchronous RPC
• Guaranteed Delivery
![Page 91: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/91.jpg)
39
Graveyard of distributed systems• Distributed Shared Mutable State
• EVIL (where N is number of nodes)N
• Serializable Distributed Transactions
• Synchronous RPC
• Guaranteed Delivery
• Distributed Objects
• “Sucks like an inverted hurricane” - Martin Fowler
![Page 92: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/92.jpg)
Instead
40
![Page 93: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/93.jpg)
Embrace the Network
Instead
40
and be d
one with itUse
Asynchronous Message Passing
![Page 94: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/94.jpg)
TRANSPARENCY
41
location
![Page 95: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/95.jpg)
42
![Page 96: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/96.jpg)
42
Scaling Up and Out is essentially
the same thing
![Page 97: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/97.jpg)
![Page 98: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/98.jpg)
Elasticity requires aMessage-DrivenArchitecture
![Page 99: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/99.jpg)
![Page 100: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/100.jpg)
AsynchronousMessage-Passingis the enabler
![Page 101: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/101.jpg)
45
Typesafe Reactive Platform
• Actors are lightweight, isolated and and communicate via asynchronous message passing
• Supervision and clustering in support of fault tolerance
• Purely asynchronous and non-blocking web framework
• No container required, no inherent bottlenecks in session management
• Asynchronous and immutable programming constructs
• Composable abstractions enabling simpler concurrency and parallelism
![Page 103: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/103.jpg)
47
Finance Internet/Social Media Mfg/Hardware Government Retail
![Page 104: Go Reactive: Building Responsive, Resilient, Elastic & Message-Driven Systems](https://reader031.vdocuments.mx/reader031/viewer/2022022412/58f9adc1760da3da068b9b92/html5/thumbnails/104.jpg)
Jonas Bonér CTO Typesafe
@jboner
Go ReactiveBuilding Responsive, Resilient,
Elastic & Message-Driven Systems