Part 4 of 7 · 2 min read
Everything is a trade-off
Each option gives something and costs something. The honest answer is "it depends on this".
Think of choosing between a motorbike and a bus for a daily commute. The bike is faster and cheaper for one person, and the bus carries many people and keeps you dry. Neither wins in every situation. The useful question is what matters on this route.
FSA states its first law: everything in software architecture is a trade-off. If an architect believes they have found something that is not a trade-off, they have probably not found the trade-off yet. This is why the usual answer to an architecture question is "it depends". The book jokes that architecture is the stuff you cannot look up. Whether REST or messaging is better, or whether microservices suit a project, depends on the environment, business drivers, budget, deadline and skills.
The book's example is an auction. A Bid Producer service must send each bid to three services: Bid Capture, Bid Tracking and Bid Analytics. There are two ways:
- Topic (publish and subscribe): the producer sends one message and every subscriber gets a copy.
- Queues (point to point): the producer sends to three queues, one per service.
| Topic | Queues | |
|---|---|---|
| Adding a new service (Bid History) | Subscribe it. The producer is unchanged | The producer must connect to a fourth queue |
| Coupling | Low | Higher |
| Contract | One shared message shape for all. A change to suit one service affects all | Each queue can have its own shape |
| Data access and security | Anyone can subscribe and see the bids | Access is set per queue |
| Monitoring and auto-scaling | Hard to track messages per consumer | Each queue is monitored and scaled alone |
The book adds a caution: the monitoring point depends on the technology. AMQP separates an exchange (what the producer sends to) from a queue (what the consumer reads), so it can offer both.
So which is better? It depends on whether extensibility or security and independent scaling matters more. That is a question about business drivers, not technology.
Trade-off
A trade-off is a situation where improving one quality worsens another, so a choice means giving something up.
Example: a topic makes it easy to add subscribers (extensibility) and makes it harder to restrict who sees the data (security).
Read it as
When someone says an option is "just better", ask what it costs. If no cost can be named, the cost has not been found yet.
The second law in the book: why is more important than how. Looking at a system's diagram shows how it is built. It does not show why. The authors found this when they kept only the diagrams from timed workshop exercises and could not explain the teams' choices afterwards.
Check yourself:
- In the auction example, which option helps when a team wants to add a fourth consumer?
- What is the cost of that option?