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
88
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
310
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
690
The Big Ball of Nouns
mkaszubowski
0
91
Modular Design in Elixir
mkaszubowski
1
370
Our three years with Elixir
mkaszubowski
0
230
Concurrency Basics for Elixir
mkaszubowski
0
110
Distributed Elixir
mkaszubowski
0
130
Software Architecture
mkaszubowski
0
120
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
440
Other Decks in Programming
See All in Programming
エンジニアが挑む、限界までの越境
nealle
1
290
MCP調べてみました! / Exploring MCP
uhzz
2
2.3k
Jakarta EE Meets AI
ivargrimstad
0
350
Cursorを活用したAIプログラミングについて 入門
rect
0
110
GitHub Copilot for Azureを使い倒したい
ymd65536
1
210
Ruby on Railroad: The Power of Visualizing CFG
ydah
0
250
Golangci-lint v2爆誕: 君たちはどうすべきか
logica0419
1
180
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
6
1.2k
「”誤った使い方をすることが困難”な設計」で良いコードの基礎を固めよう / phpcon-odawara-2025
taniguhey
0
170
RuboCop: Modularity and AST Insights
koic
2
1.9k
スモールスタートで始めるためのLambda×モノリス(Lambdalith)
akihisaikeda
2
300
KANNA Android の技術的課題と取り組み
watabee
0
140
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
137
6.9k
Designing for humans not robots
tammielis
253
25k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
Docker and Python
trallard
44
3.3k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Practical Orchestrator
shlominoach
187
11k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
Six Lessons from altMBA
skipperchong
28
3.7k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Done Done
chrislema
184
16k
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!