Overview
Designs and implements reliable ETL or ELT data pipelines. Covers the decision between ETL vs ELT, pipeline stages (extract, validate, transform, load, notify), idempotency patterns, dead-letter queues, orchestration with Apache Airflow or dbt, error handling and retries, and monitoring/ alerting for data freshness and quality.
When to Use This Skill
- Ingesting data from APIs, databases, files, or streams into a warehouse or another system.
- Building or refactoring data movement processes.
- The user mentions "data pipeline", "ETL", "ELT", "ingest", "Airflow DAG", or "dbt model".
Prerequisites
- Source and destination systems identified.
- Orchestrator (Airflow, Dagster, Prefect, or dbt + cron) or simple cron + scripts.
- Access to credentials for sources and destinations.
- Understanding of data volume and freshness requirements.
Steps
ETL vs ELT decision:
- ETL: transform before load (smaller data, complex transforms, regulatory reasons).
- ELT: load raw, transform in warehouse (modern, scalable, dbt-friendly).
Pipeline stages (template):
- Extract: pull from source (API pagination, DB query, file download).
- Validate: schema, nulls, duplicates, business rules (great expectations or custom).
- Transform: clean, join, aggregate, enrich.
- Load: idempotent upsert or append.
- Notify / quality checks: freshness, row counts, anomaly detection.
Idempotency:
- Use natural keys + upsert (MERGE, INSERT ... ON CONFLICT).
- Watermark / high-water mark for incremental loads.
- Deduplication keys.
Error handling & retries:
- Dead-letter queue or "quarantine" table for bad rows.
- Retry with exponential backoff + jitter (for transient API/DB errors).
- Alert on persistent failures.
Orchestration:
- Airflow DAG structure (tasks, dependencies, sensors, SLAs).
- dbt: models, tests, snapshots, macros for incremental logic.
Monitoring:
- Data freshness (last successful run time).
- Volume anomalies.
- Schema drift detection.
Output:
- Pipeline architecture diagram (Mermaid or text).
- Sample code for extract/validate/load (Python or SQL).
- Airflow DAG example or dbt project structure.
- Dead-letter and retry patterns.
- Alerting rules.
Examples
A complete incremental ELT pipeline from a REST API (e.g., Stripe or Shopify) into BigQuery or Postgres using Python + dbt, with idempotent load, data quality tests, and an Airflow DAG wrapper is included.
Edge Cases & Error Handling
- Late-arriving data: Use watermark + reprocessing window.
- Schema changes in source: Schema evolution strategy (add columns as nullable, alert on breaking changes).
- Large backfills: Separate backfill jobs with different resource allocation.
Verification
- Run the pipeline end-to-end on a small dataset.
- Simulate a transient failure — retries succeed.
- Simulate bad data — it goes to dead-letter, pipeline continues, alert fires.
- Check that re-running the pipeline with the same source data produces identical results (idempotent).
- Data freshness dashboard shows the expected last run time.
- Success: Data arrives reliably, errors are isolated, and the pipeline can be re-run safely.
References
1---2name: data-pipeline-builder3description: Designs and implements ETL/ELT data pipelines with error handling, retries, and monitoring. Use when moving data between systems or building a data warehouse ingestion process.4license: Apache-2.05---67## Overview89Designs and implements reliable ETL or ELT data pipelines. Covers the decision between ETL vs ELT, pipeline stages (extract, validate, transform, load, notify), idempotency patterns, dead-letter queues, orchestration with Apache Airflow or dbt, error handling and retries, and monitoring/ alerting for data freshness and quality.1011## When to Use This Skill1213- Ingesting data from APIs, databases, files, or streams into a warehouse or another system.14- Building or refactoring data movement processes.15- The user mentions "data pipeline", "ETL", "ELT", "ingest", "Airflow DAG", or "dbt model".1617## Prerequisites1819- Source and destination systems identified.20- Orchestrator (Airflow, Dagster, Prefect, or dbt + cron) or simple cron + scripts.21- Access to credentials for sources and destinations.22- Understanding of data volume and freshness requirements.2324## Steps25261. **ETL vs ELT decision**:27 - ETL: transform before load (smaller data, complex transforms, regulatory reasons).28 - ELT: load raw, transform in warehouse (modern, scalable, dbt-friendly).29302. **Pipeline stages** (template):31 - Extract: pull from source (API pagination, DB query, file download).32 - Validate: schema, nulls, duplicates, business rules (great expectations or custom).33 - Transform: clean, join, aggregate, enrich.34 - Load: idempotent upsert or append.35 - Notify / quality checks: freshness, row counts, anomaly detection.36373. **Idempotency**:38 - Use natural keys + upsert (MERGE, INSERT ... ON CONFLICT).39 - Watermark / high-water mark for incremental loads.40 - Deduplication keys.41424. **Error handling & retries**:43 - Dead-letter queue or "quarantine" table for bad rows.44 - Retry with exponential backoff + jitter (for transient API/DB errors).45 - Alert on persistent failures.46475. **Orchestration**:48 - Airflow DAG structure (tasks, dependencies, sensors, SLAs).49 - dbt: models, tests, snapshots, macros for incremental logic.50516. **Monitoring**:52 - Data freshness (last successful run time).53 - Volume anomalies.54 - Schema drift detection.55567. **Output**:57 - Pipeline architecture diagram (Mermaid or text).58 - Sample code for extract/validate/load (Python or SQL).59 - Airflow DAG example or dbt project structure.60 - Dead-letter and retry patterns.61 - Alerting rules.6263## Examples6465A complete incremental ELT pipeline from a REST API (e.g., Stripe or Shopify) into BigQuery or Postgres using Python + dbt, with idempotent load, data quality tests, and an Airflow DAG wrapper is included.6667## Edge Cases & Error Handling6869- **Late-arriving data**: Use watermark + reprocessing window.70- **Schema changes in source**: Schema evolution strategy (add columns as nullable, alert on breaking changes).71- **Large backfills**: Separate backfill jobs with different resource allocation.7273## Verification74751. Run the pipeline end-to-end on a small dataset.762. Simulate a transient failure — retries succeed.773. Simulate bad data — it goes to dead-letter, pipeline continues, alert fires.784. Check that re-running the pipeline with the same source data produces identical results (idempotent).795. Data freshness dashboard shows the expected last run time.806. Success: Data arrives reliably, errors are isolated, and the pipeline can be re-run safely.8182## References8384- [Apache Airflow](https://airflow.apache.org/)85- [dbt](https://www.getdbt.com/)86- [Great Expectations](https://greatexpectations.io/)87- [The Data Engineering Cookbook](https://github.com/andkret/Cookbook)