System designInterview preparation
Advanced·Concept·2 min read

Queue vs event vs worker?

Practice this question

Definition:

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.

Key points:

  • 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.

Interview point:

  • Separate delivery guarantees from business-effect guarantees; duplicate delivery can be normal even in a healthy system.
Adapted from 07_SYSTEM_DESIGN_ARCHITECTURE.md · “Queue vs event vs worker?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.