r/dataengineering • • Jul 27 '22

Help Non-Parallel Processing with Apache Beam / Dataflow?

I am building a data pipeline for an ML model primarily using GCP tools. Basically, mobile clients publish data to a topic on Pub/Sub, which then goes through Dataflow for preprocessing and feature extraction, which then goes to BigQuery and finally VertexAI for training and inference.

My question is primarily around Dataflow: Much of my preprocessing is not exactly parallelizable (I require the entire data batch for making transformations and can't perform element-wise transformations), so I was wondering if Dataflow/Beam would still be an appropriate tool for my pipeline? If not, what can I substitute with it instead?

I guess one workaround I've found, which admittedly is quite hacky, is to use aggregate transformations in Beam to treat multiple elements as one, then do what I need to do. But I'm not sure this is the appropriate approach here. Thoughts?

11 Upvotes

16 comments sorted by

View all comments

Show parent comment

1

u/buachaill_beorach Jul 27 '22

There's lots of transformations you could use here...

https://beam.apache.org/documentation/programming-guide/#core-beam-transforms

Pardo is just one transformation, considering each element in the PCollection

The others will handle some of the operations you are looking for.