Background processing moves work that does not fit comfortably inside a request-response cycle into an asynchronous task. The application accepts the request, schedules the work, and returns quickly while another process produces the result. section 10.0 section 10.1
Choose the Kubernetes workload according to how the work arrives and ends:
- Use a continuously running Deployment for a task queue that handles ongoing application work, commonly coordinated with Redis. section 10.0 section 10.5
- Use a Job for one-off maintenance, finite batch processing, or a queue that should terminate after completing its work. section 10.0 section 10.5
- Use a CronJob when Jobs must run periodically, such as for daily cleanup. section 10.5
Generating a thumbnail
A thumbnail request first checks the cache. On a cache miss, the service queues thumbnail generation and returns a status telling the client to retry. A worker processes the task, and a later retry serves the cached thumbnail. Scaling workers from queue length avoids mixing fast cache requests with expensive image processing on the same request path. section 6.4.3
Use the architecture figure to trace how a frontend web server hands heavy work to a background task queue. section 10.1



