akvo-rsr icon indicating copy to clipboard operation
akvo-rsr copied to clipboard

Use a real queue worker

Open zuhdil opened this issue 4 years ago • 1 comments

Currently, RSR uses cronjobs to handle one-time background tasks. Using a proper queue worker opens up the possibility to defer tasks to the queue such as sending email and processing data that was previously done in the request handler.

zuhdil avatar Oct 28 '21 09:10 zuhdil

There are multiple available choices. The most known one is probably Celery and maybe Apache Kafka.

Name active Task search/listing django ORM broker python package Ease of use setup costs
celery yes no maybe yes medium medium
django-q no no yes yes easy low
dramatiq yes no yes medium
kafka yes no no difficult high
python-rq yes no yes easy medium

With all things considered, I think going with celery is the best.

MichaelAkvo avatar Aug 17 '22 14:08 MichaelAkvo

Celery requires rabbitMQ or some other message queue. Seems like an unnecessary hassle for what we want to do (run a few jobs async). It's not like we're some high throughput application. Should we require high performance, multiple workers, and 5 9s for async tasks, we can talk about rabbitmq, kafka, etc.

Going with django-q which simply allows using postgres for queuing tasks.

MichaelAkvo avatar Feb 01 '23 15:02 MichaelAkvo