Part 6 of 7 · 3 min read
Comparing the three styles
Each style trades simplicity against scale, control and agility.
Comparing the three styles
Think of choosing a vehicle: a van, a convoy of trucks, or a fleet of couriers. Each moves goods, with different cost, speed and complexity.
FSA rates each style on a five-star scale for the characteristics from Level 0. The ratings appear in charts, so the table below gives the qualities the text states in words, not star counts.
| Pipeline | Service-based | Event-driven | |
|---|---|---|---|
| Kind | Monolithic | Distributed | Distributed |
| Partitioning | Technical (by filter type) | Domain | Mainly technical: a domain is spread across processors, mediators and topics |
| Quanta | Always one | One or more (a shared UI or database makes one) | One to many, set by shared databases and by request-reply |
| Typical size | A few filters | 4 to 12 services | Many processors |
| Strengths | Simple, cheap, easy to extend with filters | Pragmatic: good agility, testability, deployability, fault tolerance, with moderate cost | Five stars in the book for performance, scalability, fault tolerance and evolvability |
| Weak points | Scale and deploy as one unit | Shared database coupling, coarse deployment | Simplicity and testability rate low: event flows are dynamic and the number of scenarios can reach thousands |
| Data | One store | Shared database with logical partitions | Often per processor, eventual consistency |
Two points the books stress. First, service-based has no five-star rating, yet rates four stars in many areas, which explains its popularity for business applications. Second, request and reply can tie two event processors into one quantum: if the first must wait for an order id from the second, they share characteristics even though the messages are asynchronous.
A worked example (made up). A bank's loan application:
| Part | Best fit | Reason |
|---|---|---|
| Nightly credit data import and cleaning | Pipeline | One-way steps, easy to extend |
| Customer portal, loan officer tools, back office | Service-based | A few domain services, shared customer data, ACID transactions |
| Credit check, fraud scoring, notification | Event-driven | Parallel reactions to "application submitted" |
One organisation can use all three. The styles also combine: a service-based system may use events between its parts.
Interview angle
Answer in your head first, then open it.
What is the pipeline style?
One-way filters joined by pipes: producer, transformer, tester, consumer. Simple and extensible.
What is service-based architecture?
A few coarse domain services with one shared database. Distributed, but cheaper than microservices.
Broker or mediator?
Broker: no control, highest scale and decoupling. Mediator: central control and better error handling, at a cost to speed and coupling.
How does request-reply work over queues?
A request queue and a reply queue with a correlation id.
When would you avoid event-driven?
When the flow needs strict control and immediate answers, or the team cannot handle async debugging.
Check yourself:
- Which style would you pick for a nightly ETL job, and why?
- What is the main weakness of the broker topology?
Words you will meet
| Word | Plain meaning |
|---|---|
| Pipeline architecture | One-way filters joined by pipes |
| Pipe | A one-way channel between filters |
| Filter | A single-task step: producer, transformer, tester or consumer |
| Architecture quantum | An independently deployable part with its own database and characteristics |
| Service-based architecture | A few large services sharing one database |
| Domain service | A coarse-grained service for one business area |
| Entity library | Shared code that maps database tables to objects |
| API layer | A gateway between the UI and the services |
| Event-driven architecture | Components react to events asynchronously |
| Initiating event | The event that starts a flow |
| Processing event | An event announcing what a processor did |
| Broker topology | Event flow without a central coordinator |
| Mediator topology | A central mediator drives the flow with commands |
| Request-reply | A request queue and a reply queue used for answers |
| Correlation id | A header that ties a reply to its request |
| Responsiveness | How fast the user is told the action was accepted |