Hi everyone, I'm interested in using prefect to continuously replicate a bigquery table into a postgres database. Is this possible to do within prefect?
k
Kevin Kho
05/07/2021, 1:07 AM
Hi @George Tam! Are you asking more about the continuous part of the bigquery to postgres part? or both?
g
George Tam
05/07/2021, 1:08 AM
both, can prefect handle that type of extract and load job?
k
Kevin Kho
05/07/2021, 1:09 AM
If continuous streaming, not really unfortunately. If it’s like an hourly process (or even 5 min process), yes. Bigquery to postgres, if you can do it in Python (which i think it can be), then it can be done.
Kevin Kho
05/07/2021, 1:10 AM
I personally don’t know how you would get the delta of the bigquery table and postgres database. As long as you can do this and push it to postgres with Python, it should work.
Kevin Kho
05/07/2021, 1:12 AM
It might be as simple querying all the BigQuery records by the last modified? But I doubt that’s efficient unless that last modified is an index. This seems like no issue in BigQuery
g
George Tam
05/07/2021, 1:17 AM
yea hourly/ 5 min job is fine, do you have any documentation for this type of job? just learned about prefect a few hours ago and curious thank you
k
Kevin Kho
05/07/2021, 1:21 AM
Unfortunately, that’s a specific use case I don’t have documentation for but what I do have to show is the task library . The is already a BigQuery task, as well as a Postgres Task. There is also a small snippet how to use tasks in that page a bit below. If you have anymore specific questions, you can feel free to ask them here and we’ll respond to you
Kevin Kho
05/07/2021, 1:21 AM
You should also know Prefect Cloud has 10k free task runs per month, which is great to get started with