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
120
0
Share
Stateful Apps with OTP
Maciej Kaszubowski
April 20, 2017
More Decks by Maciej Kaszubowski
See All by Maciej Kaszubowski
Error-free Elixir
mkaszubowski
0
450
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
920
The Big Ball of Nouns
mkaszubowski
0
140
Modular Design in Elixir
mkaszubowski
1
420
Our three years with Elixir
mkaszubowski
0
290
Concurrency Basics for Elixir
mkaszubowski
0
160
Distributed Elixir
mkaszubowski
0
200
Software Architecture
mkaszubowski
0
170
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
530
Other Decks in Programming
See All in Programming
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
1.8k
JavaDoc 再入門
nagise
0
220
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
140
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
500
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
990
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.3k
net-httpのHTTP/2対応について
naruse
0
380
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
210
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
760
AIとRubyの静的型付け
ukin0k0
0
480
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
220
Claspは野良GASの夢をみるか
takter00
0
140
Featured
See All Featured
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Believing is Seeing
oripsolob
1
140
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
30 Presentation Tips
portentint
PRO
1
310
The Limits of Empathy - UXLibs8
cassininazir
1
340
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
210
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
150
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
350
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
210
My Coaching Mixtape
mlcsv
0
140
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
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!