$30 off During Our Annual Pro Sale. View Details »
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
100
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
410
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
830
The Big Ball of Nouns
mkaszubowski
0
110
Modular Design in Elixir
mkaszubowski
1
400
Our three years with Elixir
mkaszubowski
0
260
Concurrency Basics for Elixir
mkaszubowski
0
130
Distributed Elixir
mkaszubowski
0
170
Software Architecture
mkaszubowski
0
150
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
500
Other Decks in Programming
See All in Programming
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.4k
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3k
マスタデータ問題、マイクロサービスでどう解くか
kts
0
110
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
120
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
270
TestingOsaka6_Ozono
o3
0
160
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.2k
チームをチームにするEM
hitode909
0
340
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
140
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
350
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
38
26k
dotfiles 式年遷宮 令和最新版
masawada
1
790
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.8k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Designing for humans not robots
tammielis
254
26k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Why Our Code Smells
bkeepers
PRO
340
57k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
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!