The 80-minute job
Symptom A downstream distributed job took 80 minutes and ate the freshness gained upstream.
Cause Partitioning and join strategy didn't fit the data's shape.
Fix Re-tuned both. 80 → 44 minutes, a 45% cut.
Work / Case study 02
Moving PolicyBazaar's data from 3-hour batches to a stream that lands in 10–15 minutes, across 8,000+ tables and billions of records.
01 — The problem
Policy, customer and order data lived in transactional MySQL and MSSQL databases. Getting it to analysts went through a batch-first pipeline: AWS DMS and Sqoop pulled data into an S3 lake (raw → processed → curated), Glue and EMR transformed it, Athena served SQL, and Metabase drew the dashboards. Airflow ran it all and logged every run to a Postgres metadata store.
It was observable and auditable. It was also slow: changes reached the dashboards 2–3 hours after they happened in production, across 8,000+ tables. For an insurance business with millions of policyholders, that's not live reporting. Three constraints shaped the migration:
02 — The approach
Polling tables on a schedule means every change waits for the next batch. Change data capture flips it: Debezium tails each database's transaction log and turns every insert, update and delete into an event on Kafka the moment it commits. Watch one change travel:
Debezium tails the MySQL binlog and MSSQL change tables. Nothing scans production tables row by row.
Each table's changes get their own Kafka topic, so one busy table can't hold up the rest.
Events land in the S3 raw zone. Raw stays untouched, so anything can be reprocessed.
Glue and EMR (PySpark) build the processed and curated layers, now from minutes-old data.
Athena and Metabase didn't change for analysts. The data just stopped being hours old.
Airflow writes run status and row counts to Postgres, so pipeline health is a dashboard, not a log search.
03 — Decisions in numbers
04 — Decisions & the hard part
Symptom A downstream distributed job took 80 minutes and ate the freshness gained upstream.
Cause Partitioning and join strategy didn't fit the data's shape.
Fix Re-tuned both. 80 → 44 minutes, a 45% cut.
Choice Streaming where freshness matters, batch where it doesn't.
Why CDC everywhere over-engineers slow tables. Batch everywhere leaves orders stale.
Trade-off More than one ingestion path to run and monitor.
Choice Every run writes status, row counts and quality results to Postgres.
Why "Is today's data complete?" should be one dashboard, readable by non-engineers.
Trade-off One more store to keep in sync with the pipeline.
05 — Honest gaps & what's next
Data hours behind?