Pipes And Filters Pattern

Applications today collect an infinite amount of data. Many applications need to transform this data before applying any meaningful business logic. Tackling this complex data or a similar processor-intensive task without a thought-through strategy can have a high-performance impact. This article introduces a scalability pattern – pipes and filters – that promotes reusability and is appropriate for such scenarios.

Problem Context

Consider a scenario where incoming data triggers a sequence of processing steps, where each step brings data closer to the desired output state. The origin of data is referred to as a data source. Examples of data sources could be home IoT devices, a video feed from roadside cameras, or continuous inventory updates from warehouses. The processing steps during the transformation usually execute a specific operation and are referred to as filters. These processing steps are independent and do not have a side effect; i.e., running a step does not depend on any other steps. Each filtering step reads the data, performs a transforming operation based on local data, and produces an output. Once the data has gone through the filters, it reaches its final processed stage where it is consumed, referred to as data sink.

CategoriesUncategorized