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
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
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
540
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
750
Unity6.3 AudioUpdate
cova8bitdots
0
110
あなたはユーザーではない #PdENight
kajitack
4
340
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
660
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
220
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
400
開発ステップを細分化する、破綻しないAI開発体制
kspace
0
110
15年目のiOSアプリを1から作り直す技術
teakun
1
610
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
12
2.6k
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Amusing Abliteration
ianozsvald
0
120
How to Ace a Technical Interview
jacobian
281
24k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
130
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
140
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
280
Optimizing for Happiness
mojombo
378
71k
Building Applications with DynamoDB
mza
96
6.9k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
400
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
150
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
150
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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!