sagelearnai

Pattern: Long-Running Tasks

Some work takes seconds to hours: video transcoding, report generation, bulk imports, sending a million emails, ML inference on a batch. Doing it inside an HTTP request leads to timeouts, lost work and overloaded servers. The pattern: acknowledge fast, process in the background, and give the client a way to track progress.

In this lesson

  • Learning objectives
  • The shape
  • Making jobs safe
  • Multi-step jobs: queue or workflow engine?
  • Self-check

Questions covered

  1. Design a CSV bulk import of 10 million rows.
  2. How do you handle a job that keeps failing?

This lesson is part of System Design Interview: Concepts, Patterns & Real Designs. Unlock the full course to read it, take the quiz and track your progress.

See plans →

Last reviewed 2026-11-05.