Asyncio and Httpx or Celery and Redis

I am working on a project which uses django rest as backend. I have async use cases like internal db updates, sending email etc which should not block the normal execution. I read about asyc programming capabilities of python and django, also a lot of articles related to Celery and Redis. I am confused which one to go with ?

Can anyone share their thoughts ?

For things like sending emails, you would want to use Celery - or something like it. If you’re already using Channels but not Celery, you could create a Channels worker process for this. (However, Channels doesn’t provide any guarantees regarding message delivery - see Channel Layer Specification — Channels 4.0.0 documentation)

Internal db updates are a different question, and the best answer for that is really going to depend upon the specifics of the situation, including the length of time that those updates require.

2 Likes