The Data Pipeline Engineer designs pipelines that reliably move and transform data from source systems to analytics. The shift from ETL (transform before load) to ELT (transform after load) reflects the fact that modern data warehouses (BigQuery, Snowflake, Redshift) are powerful enough to transform data in-place - no separate transformation layer needed.
ETL vs ELT Decision
| Approach | When to use | Tools |
|---|---|---|
| ETL | Sensitive PII that must be masked before storage; legacy targets with limited compute | Spark, Glue, custom scripts |
| ELT | Modern cloud data warehouse (BigQuery, Snowflake); raw data preservation needed; schema evolution | Fivetran/Airbyte + dbt |
| Streaming ELT | Near-real-time (<5 min latency); event-driven source systems | Kafka + Flink, Pub/Sub + Dataflow |
Airflow DAG Pattern
from airflow import DAG
from airflow.operators.python import PythonOperator
from airflow.providers.postgres.hooks.postgres import PostgresHook
from datetime import datetime, timedelta
default_args = {
'owner': 'data-team',
'retries': 3,
'retry_delay': timedelta(minutes=5),
'email_on_failure': True,
}
with DAG(
dag_id='ingest_orders',
schedule='0 2 * * *', # 2am daily
start_date=datetime(2026, 1, 1),
catchup=False, # Don't run historical dates on deploy
default_args=default_args,
tags=['orders', 'ingestion'],
) as dag:
def extract_orders(**context):
# Use {{ ds }} for idempotent date-partitioned extraction
execution_date = context['ds'] # YYYY-MM-DD
hook = PostgresHook(postgres_conn_id='source_db')
records = hook.get_records(
"SELECT * FROM orders WHERE DATE(created_at) = %s",
[execution_date]
)
return records
extract = PythonOperator(task_id='extract', python_callable=extract_orders)
transform = PythonOperator(task_id='transform', python_callable=transform_orders)
load = PythonOperator(task_id='load', python_callable=load_to_warehouse)
extract >> transform >> load
Incremental Loading
-- Full refresh: truncate + reload (simple, expensive for large tables)
-- Incremental: only load new/changed records (complex, efficient)
-- Incremental pattern: use updated_at watermark
INSERT INTO warehouse.orders
SELECT * FROM source.orders
WHERE updated_at > (
SELECT COALESCE(MAX(updated_at), '1970-01-01'::timestamptz)
FROM warehouse.orders
)
ON CONFLICT (id) DO UPDATE SET
status = EXCLUDED.status,
total_cents = EXCLUDED.total_cents,
updated_at = EXCLUDED.updated_at;
-- Requires: updated_at column maintained on source, reliable for detecting changes
-- Alternative: CDC (Change Data Capture) via Debezium → Kafka → warehouse