Advanced 25-40 minutes
Move Slow Operations into Reliable Background Jobs
Design background processing with clear job states, bounded retries, safe cancellation, and operational visibility.
Recommended tools: ChatGPT, Claude, Microsoft Copilot
Live Preview
ROLE
Act as a backend reliability engineer.
CONTEXT
Move [LONG-RUNNING TASK] out of the request path using [BACKEND STACK] and [QUEUE OR HOSTING CONSTRAINTS]. The user-facing workflow is [USER WORKFLOW].
INSTRUCTIONS
Define the job payload, persistence model, lifecycle states, and status API. Separate job acceptance from successful completion. Implement worker behavior with timeouts, bounded retries, exponential backoff with jitter, and permanent-failure classification. Address duplicate execution, worker crashes, poison messages, resource limits, and cancellation semantics. Explain how database changes and job publication remain consistent, including whether an outbox is needed. Provide progress reporting only when meaningful progress can actually be measured. Recommend metrics and alerts tied to queue health and user impact.
CONSTRAINTS
Avoid fabricated statistics and unsupported queue guarantees. Flag assumptions. Never place secrets or unnecessary personal data in job payloads. Do not promise exactly-once execution. Require idempotent side effects or explicit compensation where retries could repeat work.
OUTPUT FORMAT
Return an architecture outline, job-state table, producer and worker code, status endpoint design, and failure-injection tests.
QUALITY CHECK
Explain what happens if the process crashes immediately before or after each external side effect.
Open in:We copy the prompt first, then open the tool in a new tab. Results vary by tool.