Prompt
What should I use for low-latency background work vs long-running tasks?
Latest observation
Nov 20, 2026
OpenAI APIWeb search: off
A good rule of thumb:
- Use background jobs/threads/processes for low-latency work that needs to happen soon after the request, but doesn’t need to block the user.
- Use a queue + worker system for long-running tasks that may take seconds to minutes, need retries, durability, or higher throughput.
Low-latency background work
Use when the task is:
- Short-lived
- Best-effort or non-critical
- Needs minimal overhead
- Can finish quickly without holding up the main response
Examples:
- Sending a log/event
- Updating a cache
- Lightweight notifications
- Small DB cleanup
Typical choices:
- In-process background thread/task
- Async task execution
- Lightweight job queue if you still need some durability
Long-running tasks
Use when the task is:
- Potentially slow
- Needs retry/failure handling
- Must survive process restarts
- Could tie up request workers
- Might be resource-intensive
Examples:
- Video transcoding
- Large report generation
- Batch imports/exports
- Sending many emails
- ML training/inference jobs
Typical choices:
- Message queue + worker
- Job runner / task queue system
- Separate worker service or process pool
Simple guideline
- Need it done “soon” but not critical? Background task.
- Need reliability, retries, or it may run for a while? Queue it as a long-running job.
If you tell me your stack (e.g. Python, Node, .NET, Django, FastAPI, Celery, BullMQ, etc.), I can recommend the best specific pattern and tool.