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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Maciej Kaszubowski
April 20, 2017
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Stateful Apps with OTP
Maciej Kaszubowski
April 20, 2017
More Decks by Maciej Kaszubowski
See All by Maciej Kaszubowski
Error-free Elixir
mkaszubowski
0
460
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
920
The Big Ball of Nouns
mkaszubowski
0
150
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
540
Other Decks in Programming
See All in Programming
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
560
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
120
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.7k
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
150
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
550
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
350
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.4k
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
120
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.3k
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.4k
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
11
4.3k
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
410
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
A better future with KSS
kneath
240
18k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
180
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
610
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
250
A Soul's Torment
seathinner
6
3k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
270
Accessibility Awareness
sabderemane
1
140
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
370
Build your cross-platform service in a week with App Engine
jlugia
234
18k
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!