Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django - Real Time Notification System

I am new to Django & building my own application. I want to integrate notification system (Personal, Group Level & Broadcast) from server to end user. whenever he logs into his account, notification bar displays like in facebook.

Currently Using: Django 1.8 & Python 2.7

I have gone through number of link or blogs to get to know. I came through few options as follows:

  1. Django gevent Socketio: Not supported for Django 1.8 I have done everything in Django 1.8 till yet. Please let me know, how much problems may I face while switching to Django 1.6 in terms of support & functionality.

  2. Pusher: I am not much aware of. how much it is feasible & useful to use Pusher into current existing app. Are there any compatibility Issues?

  3. Swampdragon: Seems like some compatibility issues with Django 1.8

  4. Django-Tornado, Centrifuge: I am bit afraid to change the whole code. Also, not aware of future issues, I might face.

My Questions:

  1. Please explain which one should be best to select as it is difficult to move to another on later stage.

  2. Also, switching to Django 1.6 is a better idea to support Swampdragon & Django Socketio.

Please provide links that may help.

If I am wrong, Please correct. I need your valuable suggestions.

like image 745
user3715032 Avatar asked Sep 22 '15 13:09

user3715032


2 Answers

I'm researching the same. There are some open source but customizable solutions like,

  • django-announce
  • django-websocket-redis

Out of them, I'm thinking of tyring out django-websocket-redis as I use nginx+uwsgi server setup and also it looks promising. BTW, it would be useful for everyone if you share what you found.

And to your questions,

1) Swampdragon+Pusher is neatly a good combo as it reduces a lot of core things needs to be implemented.

2) Backporting is not always a good practice. Never do that unless it blocks your app development.

UPDATE: Now we have Django channels(officially acknowledged). I'm using it for one of my live projects, and so far it performs well for real time updates with a few tons of users.

like image 198
Babu Avatar answered Oct 19 '22 09:10

Babu


You can stop thinking about monolithic systems and go over the microservices pattern, you should start with at least the following services:

  1. UI & core app

    This service is your existing django 1.8 app, nothing new. Use this for your UI.

  2. Websocket service

    Create a new service for your websocket with any framework you prefer, like tornado + django or any other framework/platform

This way your core app doesn't have any "additives" and you can feel comfortable developing it with just django. Then, to the other service you can add any other dependency without overcharging all the system with that huge list of dependencies.

Take a look at the following link: http://microservices.io/patterns/microservices.html

like image 25
Darwin Avatar answered Oct 19 '22 09:10

Darwin