Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Failing Gracefully with the Actor Model
Search
Roger Johansson
May 03, 2017
Programming
0
68
Failing Gracefully with the Actor Model
Patterns for resiliency using the Actor Model
Roger Johansson
May 03, 2017
Tweet
Share
More Decks by Roger Johansson
See All by Roger Johansson
Composing Software - Avoiding the distributed monolith
rogeralsing
1
130
Proto.Actor
rogeralsing
0
340
Why Docker at Betsson Tech
rogeralsing
0
64
Introduction to Consul
rogeralsing
0
100
Scaling Betsson Tech
rogeralsing
0
84
Scale up and out with Akka.NET
rogeralsing
0
100
Other Decks in Programming
See All in Programming
ふつうの技術スタックでアート作品を作ってみる
akira888
1
840
AIともっと楽するE2Eテスト
myohei
6
2.6k
新メンバーも今日から大活躍!SREが支えるスケールし続ける組織のオンボーディング
honmarkhunt
5
7.2k
AI時代の『改訂新版 良いコード/悪いコードで学ぶ設計入門』 / ai-good-code-bad-code
minodriven
13
3.5k
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
170
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
16
11k
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
2
810
プロダクト志向なエンジニアがもう一歩先の価値を目指すために意識したこと
nealle
0
130
Hack Claude Code with Claude Code
choplin
4
2k
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
1
18k
XP, Testing and ninja testing
m_seki
3
240
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
550
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Producing Creativity
orderedlist
PRO
346
40k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Statistics for Hackers
jakevdp
799
220k
YesSQL, Process and Tooling at Scale
rocio
173
14k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Optimizing for Happiness
mojombo
379
70k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Gamification - CAS2011
davidbonilla
81
5.4k
We Have a Design System, Now What?
morganepeng
53
7.7k
Transcript
Roger Johansson Akka.NET and Proto.Actor Founder Solution Architect - Betsson
Group Twitter: @rogeralsing Github: rogeralsing Mail:
[email protected]
Github.com/rogeralsing/presentations http://Proto.Actor
Dealing with, mitigating and preventing failures. In the small, and
at scale.
An escalator can never break: it can only become stairs.
You should never see an Escalator Temporarily Out Of Order sign, just Escalator Temporarily Stairs. Sorry for the convenience. -Mitch Hedberg
None
None
Three axioms: Send – an actor can send messages to
other actors Create – an actor can create new actors Become – an actor can decide how to handle it’s next message
”An island of consistency in a sea of concurrency” ”Shared
nothing”, ”Black box” ”Location transparent”, ”Distributable by design”
Implementations: BEAM – Erlang, Elixir, LFE JVM – Akka, Orbit
.NET – Akka.NET, Proto.Actor, Microsoft Orleans Go – Proto.Actor
Event-driven thread PID Actor State Supervision Children Mailbox Behavior Transport
/c2 /b2 /b1 /a1 /a2 /b3 /c3 /c4 /c5 /
/c1 /b1
Component Consumer 2 Consumer 1
Data Access Website Businesslogic
Vendor machine Insert coins Gets coffee Me Need more coins
Vendor machine Insert coins Out of beans Service guy Refill
beans Gets coffee Me
Service Request Application error Supervisor Manage failures Response Validation error
Client
/c2 /b2 /b1 /a1 /a2 /b3 /c3 /c4 /c5 /
/c1 OneForOne supervisor AllForOne supervisor /b1 /b3
child parent Protect state by delegating work Performs work, can
be restarted
None
child parent Attempts Delay
DB Actor DB Query DB Result DB Up DB Query
DB Error DB Down
Idle Active Gated Quarantined
Node 2 Node 1 Primary Queue Secondary
Queue Hash Slot 1 Hash Slot 2 Hash Slot 3
? ? ? ? Router Worker 1 Worker 2 Worker
3 Fan out Consumer
! ! ! ! Router Worker 1 Worker 2 Worker
3 Return first reply Consumer
! ! ! ! Router Worker 2 Worker 3 Require
same reply from at least N workers Consumer Worker 1
None
Add a delay after each message
Limit messages per time slice
Actor Mailbox
Actor Mailbox
1 2 1 2 3 3 4 4 Router Worker
1 Worker 2 Worker 3 Limit concurrent access to a resource
Worker 1 Producer Work to be done Send work Worker
2 Work to be done Send work Work Done Work Done
Always Exists, Never Fails
None
None
Node A 433 Node B 24345 Node C 82327 Hash:
989123 Node E 943772 Grain Id: Roger Names: Roger Actors: Roger : User
Node A 433 Node B 24345 Node C 82327 Hash:
989123 Node E 943772 Node F 987234 Grain Id: Roger Names: Roger Actors: Roger : User
Coordinator
The End Roger Johansson Twitter: @rogeralsing Github: rogeralsing Mail:
[email protected]
Github.com/rogeralsing/presentations http://Proto.Actor