Channels vs Django-websocket-redis

364 views
Skip to first unread message

John Byrne

unread,
Aug 4, 2017, 6:09:44 AM8/4/17
to Django users
I'm trying to evaluate these two Websockets solutions for Django. Has anyone here done compared these?

I don't fully understand what the differences between them are. I think the main difference is that Channels can generalize all requests (websocket or request/response) to be handled by channel consumers, but if that's the case, then:

1. I think you only get that if you have all your traffic come through ASGI (Daphne), right? If you route WSGI traffic and Websockets traffic separately, then wouldn't you really have something similar to the solution described here: http://django-websocket-redis.readthedocs.io/en/latest/running.html#django-with-websockets-for-redis-behind-nginx-using-uwsgi. Or is there still some big difference between that solution and Channels?

2. If #1 above is the main difference, I don't fully understand what the advantage(s) of this are. Is the ASGI-only mode required in order to have the websockets code and the wsgi code share the Django session?

Thanks!

Artem Malyshev

unread,
Aug 5, 2017, 9:19:24 AM8/5/17
to Django users
Hi, thanks for feedback!

I need some time to dig into django-websocket-redis. I'll come back to you soon.

Regards, Artem.

Artem Malyshev

unread,
Aug 5, 2017, 9:19:24 AM8/5/17
to Django users
Hi,

I look at django-websockets-redis really quickly. If you decide to use Redis ASGI layer it may look familiar.

Main differences I notice so far:

- ws4redis doesn't have concept of consumers and routing
- it's coupled to the subset of WebSocket usage
- it's propagate redis to the library api

On another hand Django Channels 

- can be used with different channels layers (redis, rabbitmq, ipc, inmemory)
- have clean api based on consumers and routing
- can handle more than just websockets. HTTP2 and HTTP1.1 are supported. Chat protocols like slack or irc are possible.
- you can trigger consumers from other consumers, without talking to websocket.

John Byrne

unread,
Aug 9, 2017, 1:42:57 PM8/9/17
to Django users
Thanks for the reply. I didn't realize that ws4redis doesn't have the concepts of consumers and routing. That's something I'll have to look into further. The documentation for ws4redis isn't great so that makes it harder.
Reply all
Reply to author
Forward
0 new messages