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.05compatibility: Claude Code, Codex, Gemini CLI6metadata:7 author: ai-skills8 version: "1.0"9 category: data-analytics10 tags: etl, elt, pipeline, airflow, dbt, data-warehouse, idempotency11---1213## Overview1415Designs 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.1617## When to Use This Skill1819- Ingesting data from APIs, databases, files, or streams into a warehouse or another system.20- Building or refactoring data movement processes.21- The user mentions "data pipeline", "ETL", "ELT", "ingest", "Airflow DAG", or "dbt model".2223## Prerequisites2425- Source and destination systems identified.26- Orchestrator (Airflow, Dagster, Prefect, or dbt + cron) or simple cron + scripts.27- Access to credentials for sources and destinations.28- Understanding of data volume and freshness requirements.2930## Steps31321. **ETL vs ELT decision**:33 - ETL: transform before load (smaller data, complex transforms, regulatory reasons).34 - ELT: load raw, transform in warehouse (modern, scalable, dbt-friendly).35362. **Pipeline stages** (template):37 - Extract: pull from source (API pagination, DB query, file download).38 - Validate: schema, nulls, duplicates, business rules (great expectations or custom).39 - Transform: clean, join, aggregate, enrich.40 - Load: idempotent upsert or append.41 - Notify / quality checks: freshness, row counts, anomaly detection.42433. **Idempotency**:44 - Use natural keys + upsert (MERGE, INSERT ... ON CONFLICT).45 - Watermark / high-water mark for incremental loads.46 - Deduplication keys.47484. **Error handling & retries**:49 - Dead-letter queue or "quarantine" table for bad rows.50 - Retry with exponential backoff + jitter (for transient API/DB errors).51 - Alert on persistent failures.52535. **Orchestration**:54 - Airflow DAG structure (tasks, dependencies, sensors, SLAs).55 - dbt: models, tests, snapshots, macros for incremental logic.56576. **Monitoring**:58 - Data freshness (last successful run time).59 - Volume anomalies.60 - Schema drift detection.61627. **Output**:63 - Pipeline architecture diagram (Mermaid or text).64 - Sample code for extract/validate/load (Python or SQL).65 - Airflow DAG example or dbt project structure.66 - Dead-letter and retry patterns.67 - Alerting rules.6869## Examples7071A 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.7273## Edge Cases & Error Handling7475- **Late-arriving data**: Use watermark + reprocessing window.76- **Schema changes in source**: Schema evolution strategy (add columns as nullable, alert on breaking changes).77- **Large backfills**: Separate backfill jobs with different resource allocation.7879## Verification80811. Run the pipeline end-to-end on a small dataset.822. Simulate a transient failure — retries succeed.833. Simulate bad data — it goes to dead-letter, pipeline continues, alert fires.844. Check that re-running the pipeline with the same source data produces identical results (idempotent).855. Data freshness dashboard shows the expected last run time.866. Success: Data arrives reliably, errors are isolated, and the pipeline can be re-run safely.8788## References8990- [Apache Airflow](https://airflow.apache.org/)91- [dbt](https://www.getdbt.com/)92- [Great Expectations](https://greatexpectations.io/)93- [The Data Engineering Cookbook](https://github.com/andkret/Cookbook)