Quantcast

Django channels being used instead of celery.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Django channels being used instead of celery.

Prafull Gaikwad
Hello everyone, 

I have a question of using Django channels. Please go through the following -

Requirement - I have a query regarding a use case of where I have a Django server communicating with multiple raspberry pis to connected to hardware probes. The Django server collects data from the pis and stores it in a database. I also have a requirement that I do not have a global IP for the raspberry pis but have one for the Django server(hosted on AWS) and would like the pis to connect to the server for communication.

Current situation - 
Currently, I am using celery where I have the Django server communicating with different celery workers hosted on different Raspberry Pis. The web application served by Django takes request from the user and updates the database collecting information from the raspberry pi. Using Celery becomes a bit complicated here as I have to have task queues in Celery broker corresponding to each raspberry pi which might be a problem while scaling it up. 

Question - 
Therefore, I wish to experiment with Django channels in this case but I cannot see a provision how can I send tasks to remote locations and get the results back.I am essentially talking about integrating Django Channels in a distributed environment where I could have consumers working remotely on different pis and Django interacts with these consumers through channels having different channels for each raspberry pi connected.

One advantage of using Celery is that it is robust as compared to channels but is noticeably slow. Moreover, the broker of the Celery framework is hosted where Django server is running and hence all the pis connect to this broker using the Django servers IP thus obviating the need to have global IPs for the pis. In my understanding, this is not possible with Django channels.

I would appreciate any suggestion of using channels in my use case keeping in account the requirement.

Thanks in advance.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/71e57ca7-61db-4e92-93bd-02340ffaa819%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Django channels being used instead of celery.

Andrew Godwin-3
Hi,

You could do this with channels - it also gets configured with a single central address (the Redis server, in this case) so it would be possible to run workers on each of the Pis and configure them to talk to the central Redis server.

However, depending on how reliable you want your results to be, what's retrieving them and how they are stored, I suspect what you want looks more like a slow, reliable task queue than a fast, unreliable one, and if so I would stick with Celery.

Andrew

On Tue, Mar 14, 2017 at 1:14 PM, Prafull Gaikwad <[hidden email]> wrote:
Hello everyone, 

I have a question of using Django channels. Please go through the following -

Requirement - I have a query regarding a use case of where I have a Django server communicating with multiple raspberry pis to connected to hardware probes. The Django server collects data from the pis and stores it in a database. I also have a requirement that I do not have a global IP for the raspberry pis but have one for the Django server(hosted on AWS) and would like the pis to connect to the server for communication.

Current situation - 
Currently, I am using celery where I have the Django server communicating with different celery workers hosted on different Raspberry Pis. The web application served by Django takes request from the user and updates the database collecting information from the raspberry pi. Using Celery becomes a bit complicated here as I have to have task queues in Celery broker corresponding to each raspberry pi which might be a problem while scaling it up. 

Question - 
Therefore, I wish to experiment with Django channels in this case but I cannot see a provision how can I send tasks to remote locations and get the results back.I am essentially talking about integrating Django Channels in a distributed environment where I could have consumers working remotely on different pis and Django interacts with these consumers through channels having different channels for each raspberry pi connected.

One advantage of using Celery is that it is robust as compared to channels but is noticeably slow. Moreover, the broker of the Celery framework is hosted where Django server is running and hence all the pis connect to this broker using the Django servers IP thus obviating the need to have global IPs for the pis. In my understanding, this is not possible with Django channels.

I would appreciate any suggestion of using channels in my use case keeping in account the requirement.

Thanks in advance.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/71e57ca7-61db-4e92-93bd-02340ffaa819%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAFwN1uoV4xvxEXxiB8m90L2TOKfyGnnCiPN0GVReZbatiLibqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Django channels being used instead of celery.

Melvyn Sopacua
In reply to this post by Prafull Gaikwad

On Tuesday 14 March 2017 13:14:37 Prafull Gaikwad wrote:

 

> Current situation -

> Currently, I am using celery where I have the Django server

> communicating with different celery workers hosted on different

> Raspberry Pis. The web application served by Django takes request

> from the user and updates the database collecting information from

> the raspberry pi. Using Celery becomes a bit complicated here as I

> have to have task queues in Celery broker corresponding to each

> raspberry pi which might be a problem while scaling it up.

 

I don't really understand why you've turned a simple push protocol into a complicated message exchange. The pis are more then capable of keeping state of last sent data, so why not just throw it over the wire and be done with it. Let the server figure out what to do with the package.

--

Melvyn Sopacua

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/1870272.AmDQeSsOn3%40devstation.
For more options, visit https://groups.google.com/d/optout.
Loading...