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
Stateful Apps with OTP
Search
Maciej Kaszubowski
April 20, 2017
Programming
0
110
Stateful Apps with OTP
Maciej Kaszubowski
April 20, 2017
Tweet
Share
More Decks by Maciej Kaszubowski
See All by Maciej Kaszubowski
Error-free Elixir
mkaszubowski
0
440
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
910
The Big Ball of Nouns
mkaszubowski
0
130
Modular Design in Elixir
mkaszubowski
1
410
Our three years with Elixir
mkaszubowski
0
280
Concurrency Basics for Elixir
mkaszubowski
0
150
Distributed Elixir
mkaszubowski
0
190
Software Architecture
mkaszubowski
0
160
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
520
Other Decks in Programming
See All in Programming
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
850
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
210
飯MCP
yusukebe
0
400
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.6k
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
570
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
Nostalgia Meets Technology: Super Mario with TypeScript
manfredsteyer
PRO
0
110
Nuxt Server Components
wattanx
0
160
CSC307 Lecture 15
javiergs
PRO
0
270
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
430
20260320登壇資料
pharct
0
130
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
190
Agile that works and the tools we love
rasmusluckow
331
21k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.8k
My Coaching Mixtape
mlcsv
0
87
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
100
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
650
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
170
We Are The Robots
honzajavorek
0
200
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
420
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
91
Transcript
Stateful Apps with OTP Maciej Kaszubowski
Realtime Apps with OTP Maciej Kaszubowski
Background
Http Server Client
Architecture Server Mobile Mobile Kurento Mobile Websocket Websocket & REST
WebRTC
Challenges
Async communication with Kurento
Async communication with Clients
Handling Concurrent Calls
Deploys, migrations & Restarts
A lot can go wrong
A lot can go wrong & Errors are dangerous
How to deal with this?
init callback
init callback
init callback
init callback
init callback
init callback
Dealing with failures
RoomServer
RoomServer
Let it FAIL
Room Supervisor RoomServer
Room Supervisor RoomServer
Room Supervisor RoomServer
After the restart, the state is gone
Room Supervisor BackupServer RoomServer
None
Room Supervisor BackupServer RoomServer
None
None
Multiple calls
Room Supervisor BackupServer RoomServer
Common Room Supervisor Room Supervisor Backup Server Room Server Room
Supervisor Backup Server Room Server
Common Room Supervisor Room Supervisor Backup Server Room Server Room
Supervisor Backup Server Room Server
Common Room Supervisor Room Supervisor Backup Server Room Server Room
Supervisor Backup Server Room Server
Common Room Supervisor Room Supervisor Backup Server Room Server
PubSub
Status Updates Server Mobile Join Mobile Room status
MyApp.Endpoint.broadcast( “room_id”, “update_status”, status )
apps/ | |—— domain/ |—— web/
Status Updates Server Mobile Mobile Subscribe Subscribe
Status Updates Server Mobile Mobile Join
Status Updates Server Mobile Mobile Status update Status update
Status Updates
Status Updates
Status Updates
Status Updates
Status Updates
Status Updates
History
History Server Call History Subscribe Status update
History
History
History
Conclusions
Simpler system
Testing is easy
Changes are easy
Great performance
We should learn from the Erlang community
A lot of fun!
Thanks!