Re:Real-Time Django: Get Started with Django Channels
by zeemonkee3 on Thursday March 17, 2016 @05:29PM
(#11307770)
Same as with Single Page Apps - websockets have their place but shouldn't be abused.
I can imagine a large Django app that uses mostly plain request/response but needs, say, a small customer service bot or occasional real time notifications. This new feature is perfect for that.
Re:Real-Time Django: Get Started with Django Channels
by Yaggo on Friday March 18, 2016 @05:27AM
(#11310703)
> However, in the context of the web (the client/server boundary), I think we need to be careful about how messaging is used. The web is made up of resources with URLs. HTTP is typically used for data transfer, and for good reason.
"Careful" == do not break urls, use pushState and make sure equivalent document is returned for GET.
Re:Real-Time Django: Get Started with Django Channels
by jkarneges on Friday March 18, 2016 @09:36PM
(#11316742)
Sounds good to me. :)
Re:Real-Time Django: Get Started with Django Channels
by karmajunkie on Friday March 18, 2016 @10:42AM
(#11312081)
Could you elaborate on specific issues you see with the use of web sockets over http/s for request response? I see this argument from time to time and I have a hard time with it when you take resource hogging out of the equation, which isn't much of a factor in many situations.
Re:Real-Time Django: Get Started with Django Channels
by jkarneges on Friday March 18, 2016 @09:55PM
(#11316823)
The issues with WebSockets are more political than technical. WebSockets are the superior technical solution with wide availability. However, at present, HTTP has better tooling (e.g. debug tools, devops tools) and developers are more familiar with it. HTTP is the de-facto standard for APIs as well.
If you're the sole developer of a Single Page App with no API, then this difference may not be important. But if you're working with a team, or across teams, then building a WebSocket-only app will bring pain. As another commenter mentioned, as long as equivalent actions are possible via HTTP then some of the issues are alleviated.
Re:Real-Time Django: Get Started with Django Channels
by karmajunkie on Tuesday March 22, 2016 @11:34AM
(#11337316)
upvoted for being a nuanced response, thanks!
However, in the context of the web (the client/server boundary), I think we need to be careful about how messaging is used. The web is made up of resources with URLs. HTTP is typically used for data transfer, and for good reason.
I sometimes see webapps communicating entirely over WebSockets. I don't mean just the realtime push part, I mean everything, request/response traffic and all. I understand that HTTP is suboptimal in certain contexts, but let's not throw the baby out with the bathwater.