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
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Stateful Apps with OTP
Maciej Kaszubowski
April 20, 2017
More Decks by Maciej Kaszubowski
See All by Maciej Kaszubowski
Error-free Elixir
mkaszubowski
0
460
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
920
The Big Ball of Nouns
mkaszubowski
0
150
Modular Design in Elixir
mkaszubowski
1
420
Our three years with Elixir
mkaszubowski
0
290
Concurrency Basics for Elixir
mkaszubowski
0
160
Distributed Elixir
mkaszubowski
0
200
Software Architecture
mkaszubowski
0
170
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
540
Other Decks in Programming
See All in Programming
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.2k
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
570
New "Type" system on PicoRuby
pocke
1
970
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.1k
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
140
RTSPクライアントを自作してみた話
simotin13
0
610
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
170
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
590
技術的負債解消で開発者の未来を開く- AIの力でコード刷新
kmd2kmd
0
110
net-httpのHTTP/2対応について
naruse
0
500
dRuby over BLE
makicamel
2
380
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
870
WENDY [Excerpt]
tessaabrams
11
38k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Become a Pro
speakerdeck
PRO
31
6k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
A Soul's Torment
seathinner
6
3k
Paper Plane
katiecoart
PRO
1
51k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
260
Music & Morning Musume
bryan
47
7.2k
Utilizing Notion as your number one productivity tool
mfonobong
4
320
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.7k
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!