Set up BigQuery CDC via Datastream to replicate Postgres or MySQL changes continuously

domain: cloud.google.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a Datastream connection profile for the source database (Postgres or MySQL), providing host, port, credentials, and SSL configuration; test the connectivity from the Datastream UI or gcloud CLI.
  2. Enable the required source prerequisites: for Postgres, set wal_level=logical and create a replication slot and publication; for MySQL, enable binary logging with binlog_format=ROW.
  3. Create a Datastream stream, selecting the connection profile, the target BigQuery dataset, and the tables to replicate; choose backfill mode (automatic for initial snapshot, or manual to skip history).
  4. Datastream writes change events into BigQuery using the Storage Write API in a merge-mode destination table; each table gets _metadata_timestamp, _metadata_operation, and other CDC system columns alongside the row data.
  5. Enable the BigQuery destination merge mode to have Datastream automatically consolidate inserts, updates, and deletes into a single up-to-date view of the table rather than an append-only changelog.
  6. Monitor stream status, latency, and error logs in the Datastream console; set up Cloud Monitoring alerts on throughput drops or replication lag exceeding your SLA.

Known gotchas

Related routes

Use Debezium to capture MySQL or PostgreSQL change events and stream them to Kafka
dataeng-general · 5 steps · unrated
Configure Flink CDC (flink-cdc) connector for MySQL source with schema change event handling in a Flink SQL pipeline
ververica.github.io · 5 steps · unrated
Stream DynamoDB changes to Lambda via DynamoDB Streams for CDC
docs.aws.amazon.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans