pythondjangocrondjango-celerydjango-commands

Celery-Django: Celery vs django management commands


I work for a travel company where we need to send periodic mails to our teams .

Since now I have been using django management commands and running them using crontabs. I was reading about what celery can do, but I am finding it really hard to understand why should I use celery ?

Also since it would be another addition to my django project and also to the database ,does it slow down the performance ?


Solution

  • I don't think you should use celery, Cron still sounds fine to me in your case, but you might want to give Celery a try.

    To me, Celery is a Python module for [asynchronous] [distributed] task queues. It allows you to dispatch lengthy tasks to multiple processes running on multiple machines (but one process on one machine is still fine). When you need to do something that takes time (like generate thumbnails, speak to an external API or generate complex reports), you can use Celery to do this in the background without blocking HTTP request for your user.

    Some advantages of Celery over crontab:

    Some disadvantages of Celery:

    And also, if it's just about sending e-mails, you could consider using a paid service such as Postmark (I am not affiliated to them), which will handle e-mail throttling for you.