Parameterized Spark jobs
Postgres read, BigQuery merge, and a continuous realtime loop on Dataproc.
Dataproc Spark and Prefect on GKE for continuous Postgres-to-BigQuery sync — users, payments, and gameplay configuration at production scale.
Problem
Analytics needed near-realtime copies of core Postgres tables while backfills had to stay reliable. Streaming state needed backup before destructive changes.
Approach
Build PySpark jobs on Dataproc for batch backfill and incremental reads, orchestrate continuous merge loops on Prefect with tiered GKE work queues. Evaluate Databricks for dedup at scale — recommend native Spark on Dataproc for cost and control.
Architecture
Replication architecture
Postgres prod → Spark backfill and incremental → Prefect merge loops → BigQuery.
Drag nodes to explore the flow
Solution highlights
Postgres read, BigQuery merge, and a continuous realtime loop on Dataproc.
Prefect sub-flows per table with GKE work pools from 2GB to 16GB by job profile.
Ingestion, Spark jobs, and dbt tests kept in sync on core tables.
A Go Cloud Function to parse, clean, and stage payment files for warehouse load.
Documented state-backup requirements before destructive replication changes.