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
0
93
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
330
Modular Design in Elixir (ElixirConf EU 2019)
mkaszubowski
2
720
The Big Ball of Nouns
mkaszubowski
0
96
Modular Design in Elixir
mkaszubowski
1
380
Our three years with Elixir
mkaszubowski
0
240
Concurrency Basics for Elixir
mkaszubowski
0
120
Distributed Elixir
mkaszubowski
0
150
Software Architecture
mkaszubowski
0
130
Let it crash - fault tolerance in Elixir/OTP
mkaszubowski
0
460
Other Decks in Programming
See All in Programming
PicoRuby on Rails
makicamel
2
120
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
1
130
プロダクト志向なエンジニアがもう一歩先の価値を目指すために意識したこと
nealle
0
120
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
320
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
240
技術同人誌をMCP Serverにしてみた
74th
1
510
WindowInsetsだってテストしたい
ryunen344
1
220
A2A プロトコルを試してみる
azukiazusa1
2
1.3k
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
270
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
20
3.8k
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
410
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
370
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Into the Great Unknown - MozCon
thekraken
39
1.9k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Git: the NoSQL Database
bkeepers
PRO
430
65k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
How STYLIGHT went responsive
nonsquared
100
5.6k
Code Reviewing Like a Champion
maltzj
524
40k
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!