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
97
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
370
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
760
The Big Ball of Nouns
mkaszubowski
0
110
Modular Design in Elixir
mkaszubowski
1
390
Our three years with Elixir
mkaszubowski
0
250
Concurrency Basics for Elixir
mkaszubowski
0
130
Distributed Elixir
mkaszubowski
0
160
Software Architecture
mkaszubowski
0
140
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
490
Other Decks in Programming
See All in Programming
CSC509 Lecture 04
javiergs
PRO
0
300
2分台で1500examples完走!爆速CIを支える環境構築術 - Kaigi on Rails 2025
falcon8823
3
3.6k
uniqueパッケージの内部実装を支えるweak pointerの話
magavel
0
1k
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1.1k
Go Conference 2025: Goで体感するMultipath TCP ― Go 1.24 時代の MPTCP Listener を理解する
takehaya
9
1.7k
詳しくない分野でのVibe Codingで困ったことと学び/vibe-coding-in-unfamiliar-area
shibayu36
3
4.9k
Railsだからできる 例外業務に禍根を残さない 設定設計パターン
ei_ei_eiichi
0
720
Advance Your Career with Open Source
ivargrimstad
0
510
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
200
私はどうやって技術力を上げたのか
yusukebe
43
18k
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
0
1.2k
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
490
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
33
8.9k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Become a Pro
speakerdeck
PRO
29
5.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Context Engineering - Making Every Token Count
addyosmani
6
240
Side Projects
sachag
455
43k
Site-Speed That Sticks
csswizardry
11
900
Documentation Writing (for coders)
carmenintech
75
5.1k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
620
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!