In a fulfilment system, what distinguishes a message-driven boundary between packing and shipping from an event-driven one?
answer
- who knows whom
- intent aimed somewhere, fact about oneself
- one recipient versus zero-to-many observers
- adding a consumer: whose code changes
- pushback needs a known recipient
basics
~10 sAddressing. A message is directed at a named recipient and expresses intent toward it; an event is a broadcast fact about what already happened, addressed to nobody, which zero or many observers may consume.
solid answer
~40 sOn a message-driven boundary packing names shipping: it sends `ShipOrder` to shipping's address, and that one recipient consumes it. The knowledge runs from sender to recipient — packing must know the address and the messages shipping accepts. On an event-driven boundary packing states a fact about itself, `OrderPacked`, and names no recipient; subscribers depend on the shape of the event, packing depends on nobody, and adding a third observer changes nothing in packing's code. The practical consequences follow from that: with an addressed recipient there is one party whose intake can push back and whose silence is noticeable, while a broadcast has no single consumer to slow down and no one whose absence the publisher can detect. The two are not exclusive — most real systems direct work and publish facts.
code
pseudocode · 7 lines// addressed: packing names shipping and directs work at it
send(to: shippingAddress, ShipOrder(orderId, boxSize))
// exactly one recipient is expected to act on this
// broadcast: packing states a fact and names nobody
publish(OrderPacked(orderId, boxSize, packedAt))
// zero, one or ten observers may react; packing is written the same waygo deeper
Recall the core contrast: a message is aimed at a named recipient and asks for something; an event announces something that already happened and names nobody who must react.
Explain the coupling direction each way and what it costs. Be ready to say which side changes when a new consumer appears, and why work that must happen deserves an addressed recipient.
Show where each belongs in one system, and that flow control and outage detection need a known recipient — a broadcast has nobody to push back or to be missed.
Treat it as a policy question: which boundaries in the estate carry owned work and which carry facts, and what evolution cost each choice locks in as teams and consumers multiply.
## The question behind the question Interviewers asking this are not after two definitions. They want to know whether you can say **who knows whom**, because that is what actually differs, and everything else — flow control, failure handling, how the system evolves — falls out of it. Take packing and shipping in a fulfilment system. - **Message-driven:** packing sends `ShipOrder(orderId, boxSize)` **to shipping's address**. The message expresses intent directed at a particular recipient. One recipient consumes it, from its own intake. - **Event-driven:** packing publishes `OrderPacked(orderId, boxSize, packedAt)` — a **statement of fact about packing itself**, addressed to nobody. Zero, one or ten observers may react. Packing neither knows nor cares. The grammar gives it away. A message is usually an imperative aimed somewhere (*ship this*); an event is usually a past-tense fact about the emitter (*this was packed*). ## What each style couples to what | | Addressed message | Broadcast event | |---|---|---| | who the sender names | a specific recipient | nobody; a topic or stream | | what it carries | intent directed at that recipient | a fact that already happened | | how many consume it | one recipient, at its own intake | zero to many observers | | adding a consumer | changes the sender or its routing | changes nothing in the publisher's code | | who depends on whom | sender depends on the recipient | observers depend on the event's shape | | flow control | a known intake can push back on a known sender | no single party to slow down | | a dead consumer | the sender can notice the silence | invisible to the publisher | Both are asynchronous, and both may run over the same machinery. Neither is defined by having a queue in the picture. The distinction is **addressing**, not transport. ## Why the distinction has teeth Three consequences are worth being able to state: 1. **Direction of change.** Adding a fourth component that wants to know when orders are packed is free in the broadcast style and a change to packing, or to its routing, in the addressed style. That is the strongest argument for publishing facts. 2. **Where responsibility lives.** An addressed message has an owner: exactly one recipient is supposed to act, so failing to act is somebody's fault and can be chased. A broadcast fact has no owner — if every observer ignores it, nothing is technically wrong, which is why work that must happen is badly expressed as an event nobody is obliged to consume. 3. **Flow control needs a recipient.** Demand is signalled by a consumer to a producer, and that requires the producer to know which consumer it is serving. With one addressed recipient, a full intake is a signal that reaches the sender. With a broadcast, there is no single consumer to represent the system's capacity, so a slow observer either falls behind or drags the publisher down to its own rate. ## Both in one system This is not an either-or architecture choice, and treating it as one is a weak answer. A healthy fulfilment system usually does both: picking **directs** work at packing because that work has an owner and must happen exactly once; packing **publishes** that an order was packed so that analytics, the customer-notification component and an internal dashboard can each observe it without packing knowing they exist. A useful test when designing a boundary: *if no component consumed this, would something be broken?* If yes, it is directed work and deserves an addressed recipient. If no — it is information about the past — it is a fact, and publishing it keeps the emitter free of consumers it should not know about. ## What the manifesto actually claims The Reactive Manifesto puts **asynchronous message passing** at the foundation, and that wording is deliberate: the foundational property is that components communicate by sending, not by holding one another's control flow. Broadcast publication is one arrangement built on that foundation, and so is the actor model's addressed mailbox. Answering that message-driven simply means publish-subscribe is the most common error here, and it inverts the relationship: publish-subscribe is a way of arranging message passing, not a synonym for it. ## How a weak answer sounds The weak answers are recognisable. One says the two terms are interchangeable. Another says events are asynchronous and messages are synchronous, which is simply untrue — both are asynchronous, and synchronicity is a different axis. A third defines the difference by the machinery in between, so that any system with a queue becomes message-driven. The answer an interviewer is waiting for names the recipient, or the absence of one, and then draws the consequences for coupling, ownership and flow control.
- Can one system be both message-driven and event-driven?Yes, and most useful ones are. Components address each other for work that has an owner and must happen, and publish facts for observers that should stay unknown to the emitter. The manifesto's claim is about the foundation being asynchronous sending, not about banning broadcast.
- Why is flow control harder on a broadcast boundary?Because no observer is the recipient. Demand is something a consumer signals to a producer, so a publisher serving many observers must either track demand per subscriber, serve everyone at the slowest one's rate, or let stragglers fall behind. There is no single party that speaks for capacity.
- How do you decide whether a boundary should carry work or a fact?Ask whether something is broken if nobody consumes it. Work that must happen has an owner and belongs in an addressed message. Information about something that already happened has no owner and belongs in a published fact, so new observers cost the emitter nothing.
saying these in an interview costs you the question
- Event-driven and message-driven are two names for one thing
- Messages are synchronous and events are asynchronous
- Any design with a queue in it is message-driven
- A published fact names the component that must handle it
- Adding an observer of a published fact requires changing the publisher's code
- Broadcast publication makes the publisher depend on its subscribers