I am currently building an API that sends transactional emails to users. I do this with a job queue, bull in particular. During development, something crossed my mind; where are these jobs actually executed? Currently, I send these jobs through bull to a redis database running in a docker container on my computer. My first thought was that these jobs run in the redis container, but I suppose that's not true, because that redis container isn't running NodeJS, which is what I use for my API.
I suppose that these jobs are actually executed on the same machine that created them. But, if that's the case, then what's so good about having a job queue? I thought the point of having a job queue was to delegate the task to something else so that the API isn't slowed down by sending all of these emails. To my understanding, all that's happening now, is just delaying the task by sending and receiving the job to and from redis.
I am quite new with job queues. I hope I've described my situation clear enough.
Thank you.