# Pipes and Filters

> Chain small, focused processing steps — each filter does one thing, pipes connect them.

- **Category**: Integration
- **Subcategory**: Message Routing
- **Canonical URL**: https://designpattern.fyi/patterns/pipes_and_filters/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Payment processing pipeline — Validate → Fraud Check → Currency Conversion → Fee Calculation → Routing. Each step is an independent filter. Fraud Check can be swapped without touching Currency Conversion. New step (AML check) inserted with zero changes to others.





## Trade-offs


### Advantages

- Each filter is independently testable

- Steps are reusable across different pipelines

- Pipeline topology can be changed without touching individual filters

- Natural fit for stream processing platforms (Kafka Streams, Apache Flink)




### Considerations & Drawbacks

- Many small steps = more latency hops

- Debugging requires tracing messages across multiple filters

- Error propagation across a pipeline is non-trivial

- Shared-nothing between filters can force repeated data lookups







---
**Reference**: [Original Source](https://www.enterpriseintegrationpatterns.com/patterns/messaging/PipesAndFilters.html)

