PART IV · BACKEND

Background Job

A task that runs outside the immediate request-response flow.

01

What is it?

A background job is work performed separately from the user's immediate request.

It is useful for tasks that take time, run on a schedule, or do not need to block the user.

Simple Definition:
A background job does work without making the user wait for it.

02

Think of it like...

Think of dropping off clothes at a laundry service.

You submit the task. The work continues in the background. You do not stand there waiting for every step.

RequestCreate JobReturn Response
JobProcessComplete
03

What does it do?

Background jobs can handle:

Email Sending

File Processing

Report Generation

Batch Processing

Data Synchronization

Scheduled Tasks

04

Where is it used?

Background jobs are used in:

Backend SystemsCloud ApplicationsData ProcessingIntegrationsNotificationsScheduled Operations
05

Example

Scenario

User requests an export.

Immediate Flow

UserExport RequestJob CreatedResponse: Processing

Background Flow

Background JobGenerate FileStore FileNotify User
06

How it connects

API RequestCreate Background JobQueue / WorkerProcessResult

The request can finish before the background work is complete.

07

Do Not Confuse

Normal Request Processing

The user waits for the request to complete.

Background Job

The work continues separately after the initial request.

Normal request: complete now.
Background job: continue separately.

08

Topic Glossary

ENGLISH TERM中文SIMPLE ENGLISH中文小白理解
Background Job后台任务A task that runs outside the immediate request-response flow.不阻塞当前用户请求、在后台继续执行的任务。
Background Processing后台处理Processing work separately from the main request.把耗时任务放到主请求之外单独执行。
Worker工作进程A process that executes background jobs.专门从任务队列中取任务并执行的进程。
Queue队列A structure used to hold jobs waiting to be processed.用来保存等待后台处理任务的一种结构。
Scheduled Job定时任务A job that runs at a planned time or interval.按固定时间或周期自动执行的后台任务。
Batch Job批处理任务A job that processes many items together.一次集中处理大量数据或业务记录的任务。
Async Processing异步处理Work that continues separately from the immediate request.请求不用一直等待,后续工作独立继续执行。
Job Status任务状态The current state of a background job.表示后台任务当前是等待、处理中还是完成等状态。
09

What to Remember

Background jobs run outside the immediate request-response flow.

They are useful for slow, scheduled, or batch operations.

Queues and workers are commonly used to process background jobs.

RequestCreate JobImmediate Response
JobWorkerProcessingResult
↑