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
350
Why Docker at Betsson Tech
rogeralsing
0
64
Introduction to Consul
rogeralsing
0
100
Scaling Betsson Tech
rogeralsing
0
92
Scale up and out with Akka.NET
rogeralsing
0
100
Other Decks in Programming
See All in Programming
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.4k
機能追加とリーダー業務の類似性
rinchoku
2
1.2k
Rancher と Terraform
fufuhu
2
240
テストコードはもう書かない:JetBrains AI Assistantに委ねる非同期処理のテスト自動設計・生成
makun
0
250
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
490
rage against annotate_predecessor
junk0612
0
160
Compose Multiplatform × AI で作る、次世代アプリ開発支援ツールの設計と実装
thagikura
0
140
print("Hello, World")
eddie
1
530
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
220
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
430
アルテニア コンサル/ITエンジニア向け 採用ピッチ資料
altenir
0
100
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
8
3.5k
Featured
See All Featured
A designer walks into a library…
pauljervisheath
207
24k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Navigating Team Friction
lara
189
15k
Git: the NoSQL Database
bkeepers
PRO
431
66k
A Tale of Four Properties
chriscoyier
160
23k
We Have a Design System, Now What?
morganepeng
53
7.8k
A Modern Web Designer's Workflow
chriscoyier
696
190k
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Typedesign – Prime Four
hannesfritz
42
2.8k
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