33 ms·
I needed a very low traffic chat feature for a website built on Django so i went looking too what existing code there was. 1 was based on simple Ajax to server
by andybak 6y ago
I needed a very low traffic chat feature for a website built on Django so i went looking too what existing code there was.
1 was based on simple Ajax to server and a server backed message store.
About a dozen used WebRTC or other advanced techniques.
I wonder how many people who could quite easily cope with the expected traffic using brain-dead simple techniques end up going the complex route because they assume that's how you do chat?
- Sean-Der 6y agoIs your chat text only? I think for media WebRTC is going to always win in the browser (unless you have the developers who can implement custom congestion control etc..) For text only I still see a couple advantages * E2E Security. With WebRTC I don't have to worry about snooping. Why should I upload my messages to a server? * Scaling/Bandwidth/Ops Burden. Massively reduced if all my clients are directly connected to each other * Ajax (TCP) can't do as much. DataChannels give me lossy/out-of-order messaging. Not useful for chat, but really great if building anything gaming/real-time
- andybak 6y agoYeah - I think all of that supports my point. Aside from security (which most users wouldn't be able to verify in any case) none of those things are relevant to low-traffic chat. i.e. "talk to our live advisors" or "collaborate with another user". The bandwidth and load is tiny and I can imagine handling hundreds or thousands of concurrent users with a traditional architecture and commodity hosting.