internalsGet Pro

Module 06 · Lesson 4 of 11Pro

Idempotent pipelines: safe to run twice

Level
Intermediate
Topic
Data pipelines: ETL and ELT
Reading time
16 min

When you finish this page you can

  1. Explain why a pipeline step runs more than once even when nothing is broken, and why a failed task may already have written its data.
  2. Choose how to load a batch so a rerun is harmless: replace the run’s slice, or merge on a key that names each row version.
  3. Commit a load and its progress marker in one transaction, so a crash leaves neither a gap nor a double count.
  4. Spot steps that change on a rerun, such as random file names, now() in a filter, and alerts.
  1. MERGE and upserts: updating tables in place18 min
  2. Errors, retries and logging in pipeline code16 min
  3. Ingestion patterns: full, incremental and append-only16 min

The 14:00 load ran twice

is an online store in India. A year after the nightly job, it takes about 500,000 orders a day. Meera, a data engineer on its data team, now loads orders every hour. An task reads the orders that changed from the orders database’s read replica and loads them into RAW.ORDERS in Snowflake. Daniel, who leads finance reporting, reads the numbers built on that table.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan