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
430
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
910
The Big Ball of Nouns
mkaszubowski
0
120
Modular Design in Elixir
mkaszubowski
1
410
Our three years with Elixir
mkaszubowski
0
270
Concurrency Basics for Elixir
mkaszubowski
0
150
Distributed Elixir
mkaszubowski
0
180
Software Architecture
mkaszubowski
0
160
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
520
Other Decks in Programming
See All in Programming
atmaCup #23でAIコーディングを活用した話
ml_bear
4
750
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
360
Windows on Ryzen and I
seosoft
0
200
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
200
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.8k
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
9
2.5k
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
160
Python’s True Superpower
hynek
0
200
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
190
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
3
1.1k
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
350
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
610
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
34k
30 Presentation Tips
portentint
PRO
1
250
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
850
How to Talk to Developers About Accessibility
jct
2
150
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
We Are The Robots
honzajavorek
0
190
The SEO identity crisis: Don't let AI make you average
varn
0
400
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
190
How STYLIGHT went responsive
nonsquared
100
6k
Producing Creativity
orderedlist
PRO
348
40k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
250
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!