Stateful Appswith OTPMaciej Kaszubowski
View Slide
Realtime Appswith OTPMaciej Kaszubowski
Background
HttpServerClient
ArchitectureServerMobileMobileKurentoMobileWebsocketWebsocket&RESTWebRTC
Challenges
Async communication withKurento
Async communication withClients
HandlingConcurrent Calls
Deploys, migrations& Restarts
A lotcan go wrong
A lotcan go wrong&Errors are dangerous
How to deal with this?
init callback
Dealing with failures
RoomServer
Let itFAIL
RoomSupervisorRoomServer
After the restart,the state is gone
RoomSupervisorBackupServer RoomServer
Multiple calls
CommonRoomSupervisorRoomSupervisorBackupServerRoomServerRoomSupervisorBackupServerRoomServer
CommonRoomSupervisorRoomSupervisorBackupServerRoomServer
PubSub
Status UpdatesServerMobile JoinMobile Room status
MyApp.Endpoint.broadcast(“room_id”, “update_status”, status)
apps/||—— domain/|—— web/
Status UpdatesServerMobileMobile SubscribeSubscribe
Status UpdatesServerMobileMobileJoin
Status UpdatesServerMobileMobile Status updateStatus update
Status Updates
History
HistoryServer CallHistorySubscribeStatus update
Conclusions
Simpler system
Testing is easy
Changes are easy
Great performance
We should learnfrom the Erlang community
A lot of fun!
Thanks!