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
77
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Failing Gracefully with the Actor Model
Patterns for resiliency using the Actor Model
Roger Johansson
May 03, 2017
More Decks by Roger Johansson
See All by Roger Johansson
Composing Software - Avoiding the distributed monolith
rogeralsing
1
140
Proto.Actor
rogeralsing
0
370
Why Docker at Betsson Tech
rogeralsing
0
75
Introduction to Consul
rogeralsing
0
110
Scaling Betsson Tech
rogeralsing
0
100
Scale up and out with Akka.NET
rogeralsing
0
120
Other Decks in Programming
See All in Programming
XHTMLが残したもの
yosuke_furukawa
PRO
1
410
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
130
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
0
430
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
420
Press start. Python's next generation.
willingc
PRO
3
310
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
420
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
170
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.5k
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
270
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
180
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
2
120
高専キャリア LT 発表内容
crysta1221
6
5.5k
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
1
11k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
The agentic SEO stack - context over prompts
schlessera
0
900
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Building an army of robots
kneath
306
46k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
220
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
From π to Pie charts
rasagy
0
350
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
190
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
270
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