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
85
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
270
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
580
The Big Ball of Nouns
mkaszubowski
0
87
Modular Design in Elixir
mkaszubowski
1
360
Our three years with Elixir
mkaszubowski
0
200
Concurrency Basics for Elixir
mkaszubowski
0
100
Distributed Elixir
mkaszubowski
0
110
Software Architecture
mkaszubowski
0
110
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
390
Other Decks in Programming
See All in Programming
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1.1k
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.8k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
430
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
300
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
210
ASP.NET Core の OpenAPIサポート
h455h1
0
120
HTML/CSS超絶浅い説明
yuki0329
0
190
Flatt Security XSS Challenge 解答・解説
flatt_security
0
730
return文におけるstd::moveについて
onihusube
1
1.4k
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.3k
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
3
2.7k
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Producing Creativity
orderedlist
PRO
343
39k
Why Our Code Smells
bkeepers
PRO
335
57k
The Pragmatic Product Professional
lauravandoore
32
6.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Music & Morning Musume
bryan
46
6.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
Thoughts on Productivity
jonyablonski
68
4.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Become a Pro
speakerdeck
PRO
26
5.1k
jQuery: Nuts, Bolts and Bling
dougneiner
62
7.6k
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!