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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
930
The Big Ball of Nouns
mkaszubowski
0
150
Modular Design in Elixir
mkaszubowski
1
420
Our three years with Elixir
mkaszubowski
0
300
Concurrency Basics for Elixir
mkaszubowski
0
160
Distributed Elixir
mkaszubowski
0
210
Software Architecture
mkaszubowski
0
170
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
550
Other Decks in Programming
See All in Programming
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
160
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
180
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
560
5分で問診!Composer セキュリティ健康診断
codmoninc
0
960
VibeCodingからAgenticWorkflowへ
starfish719
0
400
源内ハンズオン概要編
hideg
0
160
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
490
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
630
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
200
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
590
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
190
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
140
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
350
A designer walks into a library…
pauljervisheath
211
24k
Embracing the Ebb and Flow
colly
88
5.1k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
260
4 Signs Your Business is Dying
shpigford
187
22k
Color Theory Basics | Prateek | Gurzu
gurzu
0
410
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
350
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
240
Are puppies a ranking factor?
jonoalderson
1
3.8k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
410
Bash Introduction
62gerente
615
220k
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!