I am processing data using Google DataFlow is there any way to write the results to cloudsql ?
1 Answer
There is not currently a built-in way of doing this, but you can use the Sink API to write to arbitrary external systems.
Edit: The Sink API is likely overkill for writing to cloudsql; you can just directly make insert calls from a DoFn.
3 Comments
Kassem Shehady
Thanks danielm. Is it a good practice to write to cloudsql from dataflow ?
danielm
Sure, you can write to any external data storage system you need from Dataflow. Depending on your usecase, writing to BigQuery may also work, and Dataflow supports that out of the box.
Marcin Zablocki
I wouldn't say that SinkAPI is overkill, since it allows you to write to CloudSQL in a transaction - either everything is saved or nothing.