Q8 · How do you decide when to use queues, streams, or direct calls?

Back to 24 Architecture Questions.

The question is not “which broker”. The axis it turns on: whether the consumer needs history and order, or only the work. Three mechanisms move information, and they answer three different questions asked by the receiver.

Queues, streams, or direct calls A direct call requires both sides to exist at the same moment. A queue delivers work and the message is gone once acknowledged. A stream keeps an ordered, replayable log that late consumers can read from the beginning. FIGURE 8 WHAT THE RECEIVER NEEDS Direct Call Caller must both be up Callee answered now same moment, coupled failure Queue Caller fire and move on Queue work, ack, gone no history; acked work is gone Stream Writer appends facts Log ordered, replayable history and order are the product

What the answer should contain

Route by the receiver’s question. “Answer me now”: direct call, where the callee’s latency and failures become the caller’s. “Give me something to do”: queue. “Tell me everything that happened”: stream. The receiver’s need decides; the brand of broker does not.

Direct call: coupled moments. Both sides must exist and be healthy at the same instant. The callee’s latency is your latency, and its failure is your failure to handle. Use it when the answer is part of the caller’s own answer (auth, reservation, validation).

Queue: work only. Delivered, acknowledged, gone. The consumer needs the task, not the context, and nobody needs it twice: at-least-once delivery plus consumers that tolerate a repeat. Cheap to operate per message, but there is no going back: no replay, no late joiners, no rebuilding state from it.

Stream: history and order. An ordered, replayable log of facts. Consumers keep their own cursor, can join late, can re-read everything, and can rebuild a view from scratch. This is what feeds read models, audit trails, and analytics. Heavier to operate, and it pays for itself the first time you rebuild a consumer without asking the producers for anything.

Ordering is a per-key contract. A stream gives ordering within a partition or key; a queue gives ordering within a subscription, at best. Neither gives global ordering for free, and almost no business needs it either.

Ideas worth mentioning out loud

Follow-ups to expect

Red flags in an answer

Sources