Answer the question
In order to leave comments, you need to log in
Is it reasonable to use one Celery for multiple applications?
There is a Django-branded application that uses Celery as a helper dependency. Celery is raised as a separate container in the same image as the Django app. As a broker, Redis is used.
When adding some microservices to the project, it became necessary to use Celery separately from the Django service. Can this be done using just one elevated Celery container with multiple workers? Or do I need to create a separate container with Celery for each service?
Answer the question
In order to leave comments, you need to log in
Celery is a thing that can execute some of the functions you marked with a special decorator, "out there", asynchronously, in N units of parallelism, and so on. But the key point is in the codebase. If you can separate the task code into a separate project, so that these task functions will work - feel free to attach Celery to it, wrap it in a container - and here you have a task microservice.
However, I personally have not come across this, usually there is only one code base. Whether in a jung monolith or a flask service, the tasks were written by me one way or another as part of one or more services, and the project code was used: database models, either.
The scenario is quite real and normal when you split the monolith, for example, into 5 microservices. Tasks also spread over them, appearing in 3 out of 5 services. This means that for those services that have tasks, you need to raise a container next to them on the same images, already as task workers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question