Problem
A monolithic processing routine that parses, validates, transforms, and enriches data is hard to test, reuse, or scale. One slow step limits the whole flow and every change risks the entire routine.
Also known as: pipeline-architecture, filter-chain
Decompose a processing task into independent steps connected by channels so steps can be reordered, reused, and scaled separately.
A monolithic processing routine that parses, validates, transforms, and enriches data is hard to test, reuse, or scale. One slow step limits the whole flow and every change risks the entire routine.
Pipes and filters is one of the oldest architectural styles, familiar from Unix shells: each program does one job and output flows to the next. The same idea powers stream processors, build pipelines, and HTTP middleware.
Each filter has one input and one output and no knowledge of its neighbors. Pipes carry messages in order, and backpressure keeps a fast producer from overwhelming a slow consumer.
cat access.log | grep 500 | cut -d' ' -f1 | sort | uniq -c
[Source] -> (pipe) -> [Parse] -> (pipe) -> [Validate]
-> (pipe) -> [Enrich] -> (pipe) -> [Sink]
\-> dead-letter queue for failures
When filters are separate services connected by queues, a slow stage can be scaled out by adding consumers, provided messages are independent. Where order matters, partition by a key so each key is handled sequentially.
Low in-process; queues needed when distributed
Medium — monitor each stage and backlog
Low — simple mental model
Slow filter causing unbounded queue growth upstream
Poison message blocking or repeatedly failing a stage
Message format change breaking downstream filters