04.1.5 · Skill in Software development

Asynchronous systems

Queues, background jobs and events for work that does not happen instantly.

Emails, imports, AI calls and payments often run asynchronously. Queues and background jobs make products more responsive and resilient, but add retries, ordering and failure states to think about. Users need feedback about work still in progress.

Your status · Asynchronous systems

Saved in this browser. Sign in to keep it on every device.It colours this skill's tile on your map.

Why it matters for a product engineer

Emails, imports, file conversions, AI calls and webhooks take time or fail now and then. Running them outside the request keeps the product fast and lets work survive a failure. The price is new questions: retries, order, duplicates, and how to tell the user that work is still in progress.

How to do it

  1. Move work out of the request when it is slow, depends on another service, or can wait a few seconds.
  2. Put it on a queue or a job system, not a loop that checks a table every minute.
  3. Make each job safe to run twice. Retries will happen.
  4. Decide what happens when a job keeps failing: how many retries, how long to wait, where the failed job goes.
  5. Store the job’s state so the interface can show “processing”, “ready” or “failed”.
  6. Watch the queue: its length, its age and the failure rate.

Common mistakes

  • Doing slow work inside the request because it is simpler today.
  • Cron jobs for a stream of events.
  • Jobs that send an email twice when they are retried.
  • No dead-letter place, so failed work disappears.
  • Users who see nothing while work runs in the background.

Example

In Papermark, the heavy work runs outside the request. Jobs turn PDFs into page images, optimise videos, build bulk downloads and send notifications, so none of it happens while a visitor waits. Zernio handled platform events with cron jobs, “not a good way to handle many events”, Miquel Palet said, and they were the first thing moved to Cloudflare queues. (Papermark, Zernio)

Flow

A PDF in Papermark, from upload to pages a visitor can read

RequestBackground jobVisitorUploadAnswers at onceTrigger.dev jobOutside the requestPage imagesOne per pageA visitor readsNo waitingRequestBackground jobVisitorUploadAnswers at onceTrigger.dev jobOutside the requestPage imagesOne per pageA visitor readsNo waiting

The slow step happens once, in a job, before anyone reads. Video, bulk downloads and notifications follow the same pattern.

Observedlib/trigger in Papermark's repository, 17 Nov 2026

Sources: What do you mean by "event-driven"? (Martin Fowler) ↗

In practice

Real products

Resources

2
  • articleGo deeper
    What do you mean by "event-driven"? ↗
    Martin Fowler · 2017 · 9 min

    Four different things people mean by event-driven, and the trade-offs of each.

  • courseGo deeper
    The system design primer ↗
    Donne Martin · free guide

    A broad, free tour of scaling techniques: caching, replication, queues, load balancing and their trade-offs.