Data Pipeline Architect
This skill provides guidance for designing robust, scalable data pipelines that move data reliably from sources to destinations.
Core Competencies
- ETL vs ELT: Traditional Extract-Transform-Load vs modern Extract-Load-Transform patterns
- Orchestration: Airflow, Dagster, Prefect, dbt for workflow management
- Data Quality: Validation, monitoring, lineage tracking
- Scalability: Batch vs streaming, partitioning, parallelization
Pipeline Design Process
1. Requirements Analysis
To begin pipeline design, gather:
- Source systems and data formats (APIs, databases, files, streams)
- Target destinations (data warehouse, lake, lakehouse)
- Freshness requirements (real-time, hourly, daily)
- Data volume and velocity estimates
- Quality and compliance requirements
2. Architecture Selection
Batch Pipelines - For periodic bulk processing:
- Schedule-driven (hourly, daily, weekly)
- Higher latency tolerance
- Simpler error recovery (re-run entire batch)
- Tools: Airflow, dbt, Spark
Streaming Pipelines - For real-time requirements:
- Event-driven processing
- Sub-second to minute latency
- Complex state management
- Tools: Kafka, Flink, Spark Streaming
Hybrid Approaches - Lambda or Kappa architecture:
- Batch layer for completeness
- Speed layer for low latency
- Serving layer for queries
3. ETL vs ELT Decision
ETL (Transform before Load):
- When target has limited compute
- When transformation reduces data volume significantly
- When sensitive data must be masked before landing
- Legacy data warehouse patterns
ELT (Transform after Load):
- Modern cloud warehouses with cheap compute
- When raw data preservation is needed
- When transformations change frequently
- dbt-style transformations in warehouse
4. Pipeline Components
Extraction Layer:
- Full extraction vs incremental (CDC, timestamp-based)
- API pagination and rate limiting
- Connection pooling and retry logic
- Schema detection and drift handling
Transformation Layer:
- Data cleansing and standardization
- Business logic application
- Aggregation and denormalization
- Type casting and null handling
Loading Layer:
- Upsert strategies (merge, delete+insert)
- Partitioning schemes (time, hash, range)
- Index management
- Transaction boundaries
5. Error Handling Patterns
┌─────────────────────────────────────────────────────────┐
│ Pipeline Execution │
├─────────────────────────────────────────────────────────┤
│ ┌─────────┐ ┌───────────┐ ┌──────────┐ │
│ │ Extract │───▶│ Transform │───▶│ Load │ │
│ └────┬────┘ └─────┬─────┘ └────┬─────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌───────────┐ ┌──────────┐ │
│ │ Retry │ │ Dead Letter│ │ Rollback │ │
│ │ w/Backoff│ │ Queue │ │ Checkpoint│ │
│ └─────────┘ └───────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────┘
- Retry with backoff: Transient failures (network, rate limits)
- Dead letter queues: Poison messages that can't be processed
- Checkpointing: Resume from last successful point
- Idempotency: Safe to re-run without duplicates
6. Data Quality Framework
Implement checks at each stage:
| Stage |
Check Type |
Example |
| Extract |
Completeness |
Row count matches source |
| Extract |
Freshness |
Data timestamp within SLA |
| Transform |
Validity |
Values in expected ranges |
| Transform |
Uniqueness |
Primary keys unique |
| Load |
Reconciliation |
Target matches source totals |
| Load |
Integrity |
Foreign keys valid |
7. Monitoring and Observability
Essential metrics to track:
- Pipeline duration and trends
- Row counts at each stage
- Error rates and types
- Data freshness (time since last successful run)
- Resource utilization
Alert on:
- SLA breaches (data not fresh)
- Anomalous row counts (±20% from baseline)
- Schema changes in sources
- Repeated failures
Common Patterns
Slowly Changing Dimensions (SCD)
- Type 1: Overwrite (no history)
- Type 2: Add row with validity dates
- Type 3: Previous value column
- Type 4: History table
Incremental Processing
-- Timestamp-based incremental
SELECT * FROM source
WHERE updated_at > {{ last_run_timestamp }}
-- CDC-based (Change Data Capture)
-- Captures inserts, updates, deletes from transaction log
Idempotent Loads
-- Delete + Insert pattern
DELETE FROM target WHERE date_partition = '2024-01-15';
INSERT INTO target SELECT * FROM staging WHERE date_partition = '2024-01-15';
-- Merge/Upsert pattern
MERGE INTO target t
USING staging s ON t.id = s.id
WHEN MATCHED THEN UPDATE SET ...
WHEN NOT MATCHED THEN INSERT ...
References
references/orchestration-patterns.md - Airflow, Dagster, Prefect patterns
references/data-quality-checks.md - Validation frameworks and rules
references/pipeline-templates.md - Common pipeline architectures
1---2name: data-pipeline-architect3description: Designs ETL/ELT data pipelines with proper extraction, transformation, and loading patterns, including orchestration, error handling, and data quality validation.4license: MIT5---6
7# Data Pipeline Architect
8
9This skill provides guidance for designing robust, scalable data pipelines that move data reliably from sources to destinations.
10
11## Core Competencies
12
13- **ETL vs ELT**: Traditional Extract-Transform-Load vs modern Extract-Load-Transform patterns
14- **Orchestration**: Airflow, Dagster, Prefect, dbt for workflow management
15- **Data Quality**: Validation, monitoring, lineage tracking
16- **Scalability**: Batch vs streaming, partitioning, parallelization
17
18## Pipeline Design Process
19
20### 1. Requirements Analysis
21
22To begin pipeline design, gather:
23- Source systems and data formats (APIs, databases, files, streams)
24- Target destinations (data warehouse, lake, lakehouse)
25- Freshness requirements (real-time, hourly, daily)
26- Data volume and velocity estimates
27- Quality and compliance requirements
28
29### 2. Architecture Selection
30
31**Batch Pipelines** - For periodic bulk processing:
32- Schedule-driven (hourly, daily, weekly)
33- Higher latency tolerance
34- Simpler error recovery (re-run entire batch)
35- Tools: Airflow, dbt, Spark
36
37**Streaming Pipelines** - For real-time requirements:
38- Event-driven processing
39- Sub-second to minute latency
40- Complex state management
41- Tools: Kafka, Flink, Spark Streaming
42
43**Hybrid Approaches** - Lambda or Kappa architecture:
44- Batch layer for completeness
45- Speed layer for low latency
46- Serving layer for queries
47
48### 3. ETL vs ELT Decision
49
50**ETL (Transform before Load)**:
51- When target has limited compute
52- When transformation reduces data volume significantly
53- When sensitive data must be masked before landing
54- Legacy data warehouse patterns
55
56**ELT (Transform after Load)**:
57- Modern cloud warehouses with cheap compute
58- When raw data preservation is needed
59- When transformations change frequently
60- dbt-style transformations in warehouse
61
62### 4. Pipeline Components
63
64**Extraction Layer**:
65- Full extraction vs incremental (CDC, timestamp-based)
66- API pagination and rate limiting
67- Connection pooling and retry logic
68- Schema detection and drift handling
69
70**Transformation Layer**:
71- Data cleansing and standardization
72- Business logic application
73- Aggregation and denormalization
74- Type casting and null handling
75
76**Loading Layer**:
77- Upsert strategies (merge, delete+insert)
78- Partitioning schemes (time, hash, range)
79- Index management
80- Transaction boundaries
81
82### 5. Error Handling Patterns
83
84```
85┌─────────────────────────────────────────────────────────┐
86│ Pipeline Execution │
87├─────────────────────────────────────────────────────────┤
88│ ┌─────────┐ ┌───────────┐ ┌──────────┐ │
89│ │ Extract │───▶│ Transform │───▶│ Load │ │
90│ └────┬────┘ └─────┬─────┘ └────┬─────┘ │
91│ │ │ │ │
92│ ▼ ▼ ▼ │
93│ ┌─────────┐ ┌───────────┐ ┌──────────┐ │
94│ │ Retry │ │ Dead Letter│ │ Rollback │ │
95│ │ w/Backoff│ │ Queue │ │ Checkpoint│ │
96│ └─────────┘ └───────────┘ └──────────┘ │
97└─────────────────────────────────────────────────────────┘
98```
99
100- **Retry with backoff**: Transient failures (network, rate limits)
101- **Dead letter queues**: Poison messages that can't be processed
102- **Checkpointing**: Resume from last successful point
103- **Idempotency**: Safe to re-run without duplicates
104
105### 6. Data Quality Framework
106
107Implement checks at each stage:
108
109| Stage | Check Type | Example |
110|-------|------------|---------|
111| Extract | Completeness | Row count matches source |
112| Extract | Freshness | Data timestamp within SLA |
113| Transform | Validity | Values in expected ranges |
114| Transform | Uniqueness | Primary keys unique |
115| Load | Reconciliation | Target matches source totals |
116| Load | Integrity | Foreign keys valid |
117
118### 7. Monitoring and Observability
119
120Essential metrics to track:
121- Pipeline duration and trends
122- Row counts at each stage
123- Error rates and types
124- Data freshness (time since last successful run)
125- Resource utilization
126
127Alert on:
128- SLA breaches (data not fresh)
129- Anomalous row counts (±20% from baseline)
130- Schema changes in sources
131- Repeated failures
132
133## Common Patterns
134
135### Slowly Changing Dimensions (SCD)
136
137- **Type 1**: Overwrite (no history)
138- **Type 2**: Add row with validity dates
139- **Type 3**: Previous value column
140- **Type 4**: History table
141
142### Incremental Processing
143
144```sql
145-- Timestamp-based incremental
146SELECT * FROM source
147WHERE updated_at > {{ last_run_timestamp }}
148
149-- CDC-based (Change Data Capture)
150-- Captures inserts, updates, deletes from transaction log
151```
152
153### Idempotent Loads
154
155```sql
156-- Delete + Insert pattern
157DELETE FROM target WHERE date_partition = '2024-01-15';
158INSERT INTO target SELECT * FROM staging WHERE date_partition = '2024-01-15';
159
160-- Merge/Upsert pattern
161MERGE INTO target t
162USING staging s ON t.id = s.id
163WHEN MATCHED THEN UPDATE SET ...
164WHEN NOT MATCHED THEN INSERT ...
165```
166
167## References
168
169- `references/orchestration-patterns.md` - Airflow, Dagster, Prefect patterns
170- `references/data-quality-checks.md` - Validation frameworks and rules
171- `references/pipeline-templates.md` - Common pipeline architectures