LESSON 12 / 15·2 min readAdvanced

Queue vs event vs worker?

01 Understand02 Recall03 Prepare

Understand the concept

A queue holds work waiting to be processed, a worker executes that work, and an event describes a fact that already happened. Commands request an action, while events can notify multiple interested consumers. Delivery and acknowledgement rules determine what happens when workers crash or messages are repeated.

Important ideas

  • A queue holds work; a worker processes it.

  • An event describes something that happened, such as OrderCreated.

  • Delivery may repeat, so consumers need safe duplicate handling.

  • Persist processing state before acknowledging when loss would be unacceptable, and use operation IDs to recognize repeated delivery.

PAUSE & RECALL

Can you explain it without the notes?

Queue vs event vs worker?

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

A queue holds work waiting to be processed, a worker executes that work, and an event describes a fact that already happened. Commands request an action, while events can notify multiple interested consumers. Delivery and acknowledgement rules determine what happens when workers crash or messages are repeated.

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

  • Separate delivery guarantees from business-effect guarantees; duplicate delivery can be normal even in a healthy system.
Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: How do I design retries and dead-letter handling?

Adapted from 07_SYSTEM_DESIGN_ARCHITECTURE.md · “Queue vs event vs worker?”. Examples are study fragments; framework behavior can depend on your version.