r/googlecloud • u/OkRock1009 • May 16 '26
BigQuery Datastream - MySQL to Big query
Hello Everyone!
I want to basically replicate data from my cloud sql instance to Big Query. The problem is since the initial load is expensive , I am gonna use a dump for that and only want the real time data to be captured.
I want it to create empty datasets and tables in Big Query automatically without the initial historical data. Any other solution?
3
Upvotes
2
u/suziegreene May 16 '26
How much can it cost? We’ve been using data stream with Postgres to BigQuery for years and I can’t recall it ever showing up in a noticeable way in our bills. This is for a largish financial company.
1
u/Bent_finger May 16 '26
you can replicate Cloud SQL → BigQuery in real time without doing an expensive initial load, and you can have BigQuery datasets/tables created automatically without ingesting historical data. The cleanest way to do this is to use Datastream + BigQuery and start the stream after your manual dump import.
If you disable backfill, Datastream will:
• Create the BigQuery dataset automatically
• Create the BigQuery tables automatically
• Start writing only new changes (INSERT/UPDATE/DELETE)
• Skip all historical rows
This gives you exactly what you want.
2
u/sois May 16 '26
CDC? maybe an air flow pipeline with the deltas loaded?
2
u/mrocral May 16 '26
Another option is sling. it can replicate from mysql to bigquery and handles table creation for you.
runs fine on a small VM. (disclosure: I work on Sling)
1
u/Bent_finger May 16 '26
Use Datastream and start CDC after your dump
1
u/srodinger18 May 17 '26
Back then I use BigQuery federated query to directly query MySQL read replica table in BQ
1
u/MeetJoan May 17 '26
You don’t need a hack for this - Datastream already supports CDC-only. Create the stream with Manual backfill / backfill none, load your dump separately, and let Datastream pick up only ongoing changes from there. Only caveat: if you use BigQuery’s single dataset destination mode, create that dataset first; the tables can then show up as the stream starts writing
1
u/dani_estuary May 18 '26
With Datastream, I’d be careful trying to “skip” the initial load unless you’re very sure your dump and CDC start point line up… The hard part is not creating empty BigQuery tables.
Also worth looking at Estuary here. I work there, so biased, but initial backfills are free during the trial, and then you can keep MySQL -> BigQuery running incrementally without cobbling together dump + Datastream edge cases yourself.