Learning Log
I was playing around with this concept called background jobs (or multi-process apps).
Normally we have one HTTP server handling requests. But what if the request includes heavy work like video processing, image processing, generating files, or even sending emails? Keeping those tasks inside the request-response cycle can make users wait for seconds or even minutes.
The idea is simple: let the server respond quickly and move the heavy work into its own process (a worker).
For example, when a user signs up, they don't need to wait for the welcome email to be sent. The server can immediately say "Registration successful", save the email job in Redis, and a separate worker process will pick it up and send the email a few seconds later.
Same with YouTube. The uploader doesn't wait for the entire video processing to finish. The upload is accepted, and the heavy processing happens later in the background.
So basically, background jobs are about separating slow, heavy work from the normal request-response flow and letting another process handle it. Since we now have a server process and a worker process running independently, we've built a simple multi-process application.
60 ·