Reputation: 95
Am I scalable enough?
My goal is to create a MySQL WebRTC module. After researching all of the alternatives for server-to-client communication, SSE is good for pushing MySQL notifications. I want to inevitably replace WebSockets.
Can I really use window.onbeforeunload()?
Socket.IO and Node servers are < lyt > $var < /lyt >, but i cannot rely on my hosting providers for open ports. So I found out SSE is highly compatible, as well as window.onbeforeunload = () => abort(id); Imagine an SQL->PHP->Client Signaling Server
How is the performance?
I don't care about latency, since I am only using SSE for notifications. Web RTC would be for two-way or three-way calls only. SSE for chat, would only need update my poll-counts client-side, and update my sql record server-side.
Thus
I have managed Client<-Server<-MySQL topography, but how do disconnections work with AJAX onbeforeunload (eg: very small json less than 2kb@1kbps). Reinventing natural heartbeats from sockets, Live audio/video for 2-or-3-way streaming is done with WebRTC, yet may we, RTCDataChannel(id) as to EventSource(MySQL)
???
After brainstorming, I think window.onbeforeunload will do trick if its synchronous, not async. Thus should work really fast, for a good UI. I just want to flush out MySQL Records. So SSE can tell the other users "I'm no longer here"
[https://caniuse.com/#feat=eventsource]
[https://caniuse.com/#search=beforeunload]
Upvotes: 1
Views: 1306
Reputation: 155
So, you want to use SSE and MySQL as a signalling server.
Actually, you have the assumption that you need to you MySQL for that, and you don't. I was able to create a reliable signalling server with plain text (it is just a few lines that are being exchanged anyway) instead of a database. See https://github.com/nielsbaloe/webrtc-php .
Regarding your points of attention:
Upvotes: 2