Would it be feasible or an overkill to use channels for real time notification in a Django application.

43 views
Skip to first unread message

Rajesh Yogeshwar

unread,
Nov 19, 2017, 8:29:54 AM11/19/17
to Django users
I have a SAAS application built using django. I want to now add real time notifications to my application. Everywhere I have looked one of the top suggestions is to use channels. But what I would like get to know is
  • Would it be an overkill to use channels only for notifications purpose?
  • How scalable and future proof is it?
I have also failed to find a single example that would demonstrate use of channels for notifications purpose.

Andrew Godwin

unread,
Nov 19, 2017, 2:02:52 PM11/19/17
to django...@googlegroups.com
You can indeed use Channels as the backbone of a notifications system using WebSockets, but you'll need to overlay your own state logic on top (notably, "what has already been sent to the client?") You can also in theory use Channels 1 to do long-polling, but this is likely going to make a lot more sense once Channels 2 is out and you can write native async HTTP handlers.

Given that not all browsers or corporate networks support WebSockets, I would suggest you first build an AJAX short-polling based solution for maximum compatability (but it's going to strain your servers as more people use it), then add in either long-polling, WebSockets or both as options based on what gives you the best return in terms of UX and development time.

Andrew

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/92674051-953c-4176-9ef9-05059b3be0a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages