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
110
0
Share
Stateful Apps with OTP
Maciej Kaszubowski
April 20, 2017
More Decks by Maciej Kaszubowski
See All by Maciej Kaszubowski
Error-free Elixir
mkaszubowski
0
440
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
910
The Big Ball of Nouns
mkaszubowski
0
130
Modular Design in Elixir
mkaszubowski
1
410
Our three years with Elixir
mkaszubowski
0
280
Concurrency Basics for Elixir
mkaszubowski
0
150
Distributed Elixir
mkaszubowski
0
190
Software Architecture
mkaszubowski
0
160
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
520
Other Decks in Programming
See All in Programming
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
23
13k
Server-Side Kotlin LT大会 vol.18 [Kotlin-lspの最新情報と Neovimのlsp設定例]
yasunori0418
1
150
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
3
350
iOS機能開発のAI環境と起きた変化
ryunakayama
0
180
Kingdom of the Machine
yui_knk
2
310
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
200
Running Swift without an OS
kishikawakatsumi
0
840
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
3
280
ハーネスエンジニアリングとは?
kinopeee
10
5.2k
Coding as Prompting Since 2025
ragingwind
0
830
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
240
Angular Signal Forms
debug_mode
0
110
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
270
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
130
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
220
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
530
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
320
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
140
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
350
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
330
How to Ace a Technical Interview
jacobian
281
24k
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!