Explore
Module 1 · Part 1 of 12 · Free preview

Part 1

Chapter 1: The 2 AM Alarm--It was 2:17 AM on a Tuesday when Sarah’s phone buzzed for the fifth time in ten minutes. The dashboard that the executive team checked every morning before their 9 AM standup was showing something impossible: negative revenue for the last eight hours. Not zero. Negative. As if customers were returning more products than they had purchased, but the returns system had been quiet all day. Sarah was the data engineer on call, and she had written that pipeline from scratch six months ago. She knew every line of code, every transformation, every join. And she had absolutely no idea why it was wrong.She pulled up the logs. The pipeline had run successfully.

No errors. No warnings. The source data looked clean. The transformations had executed in order. The final table had been written. Everything was green, and everything was wrong.Over the next four hours, Sarah learned a lesson that no textbook had ever taught her. The problem wasn't a bug in her code. The problem was in her assumptions about how data behaves. She had assumed that if a record arrived at 2:00 PM, it belonged to the 2:00 PM hour. She had assumed that if a transaction was marked as "completed", it would never change. She had assumed that running the same pipeline twice would produce the same results. Every single assumption was wrong.By 6:30 AM, she had found the root cause.

A separate system had backfilled three months of corrected transaction data, re-issuing records with the same transaction IDs but different amounts. Her pipeline, which processed data in batches every hour, had seen the updated records and dutifully added them to the current day’s revenue. Meanwhile, the original transactions from three months ago remained in the historical tables. The revenue for today was now inflated by transactions that had actually occurred a quarter ago. And the dashboard, which subtracted returns from gross sales, was now subtracting nothing from a number that was already wrong.Sarah fixed the pipeline by making it idempotent—capable of being rerun without creating duplicates or double-counting—and added a check for backfilled data.

Keep reading — free

Sign in with your SamEnrico account to read the whole of lesson 1.

Sign in