Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Stateful Apps with OTP
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Maciej Kaszubowski
April 20, 2017
Programming
130
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
480
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
940
The Big Ball of Nouns
mkaszubowski
0
160
Modular Design in Elixir
mkaszubowski
1
420
Our three years with Elixir
mkaszubowski
0
310
Concurrency Basics for Elixir
mkaszubowski
0
180
Distributed Elixir
mkaszubowski
0
220
Software Architecture
mkaszubowski
0
180
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
560
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
370
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
270
Workers Cache を知る
syumai
0
290
AI活用は、個人から組織へ|マルチプレイヤーエージェントハーネス「QM」の社内活用事例 / AI use is moving from individuals to orgs
rkaga
1
260
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
180
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
590
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
120
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
490
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
220
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
260
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
140
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
160
Featured
See All Featured
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Mobile First: as difficult as doing things right
swwweet
225
10k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
We Have a Design System, Now What?
morganepeng
55
8.3k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Building Applications with DynamoDB
mza
96
7.2k
How to Talk to Developers About Accessibility
jct
2
560
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
580
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
610
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
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!