When your platform serves other businesses, every request that comes in turns into several calls out to SMS gateways, WhatsApp, email, mobile money and AI models. Those calls are slow, rate limited and they cost money. This talk shows how we moved that work into background jobs and spread it across many async Python workers sharing a Redis queue. We cover splitting work into jobs, scaling workers out, staying within provider limits, recovering when a worker crashes, and retrying without charging anyone twice.
We run a platform that other businesses build their operations on. Each request we receive turns into several calls to outside APIs, such as SMS, WhatsApp, email, payments and AI. Those calls are slow and rate limited, and each one costs money, so none of them can run inside the web request.
This talk shows how we handle that with background workers in async Python. The API accepts the request, splits it into jobs and puts them on a shared queue. A pool of workers picks the jobs up and makes the outside calls. When traffic grows, we add workers.
We will cover:
- how we split one request into jobs,
- how jobs are shared across many workers,
using ARQ