Skill

Design and Implement Scalable Data Pipelines

Expert data pipeline architecture skill for ETL/ELT, Lambda/Kappa/Lakehouse patterns, dbt/Spark transformation, and Delta Lake/Iceberg storage.

Works with airflowdbtsparkdelta lakeiceberg

79
Spark score
out of 100
Updated 24 days ago
Version 13.6.1

Add to Favorites

Why it matters

Architect and build robust, cost-effective data pipelines for batch and streaming data. Ensure reliability, scalability, and high data quality from ingestion to serving.

Outcomes

What it gets done

01

Design ETL/ELT, Lambda, Kappa, and Lakehouse architectures.

02

Implement batch and streaming data ingestion with error handling.

03

Orchestrate workflows using Airflow or Prefect.

04

Ensure data quality with Great Expectations and dbt tests.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-data-engineering-data-pipeline | bash

Overview

Data Pipeline Architecture

A data pipeline architecture skill covering ETL/ELT/Lambda/Kappa/Lakehouse patterns, dbt/Spark transformation, Delta Lake/Iceberg storage, and cost optimization. Use for data pipeline architecture tasks needing pattern selection, ingestion/orchestration implementation, or data quality/monitoring setup.

What it does

This skill provides expert data pipeline architecture for scalable, reliable, cost-effective batch and streaming data processing, covering ETL/ELT, Lambda, Kappa, and Lakehouse architecture patterns, batch/streaming ingestion, workflow orchestration with Airflow/Prefect, transformation via dbt and Spark, ACID-transactional Delta Lake/Iceberg storage, data quality frameworks (Great Expectations, dbt tests), pipeline monitoring (CloudWatch/Prometheus/Grafana), and cost optimization through partitioning, lifecycle policies, and compute selection.

Its architecture design step assesses sources/volume/latency/targets and selects the right pattern (ETL: transform before load; ELT: load then transform; Lambda: batch plus speed layers; Kappa: stream-only; Lakehouse: unified), designing the flow from sources through ingestion, processing, storage, and serving with observability touchpoints throughout.

Ingestion implementation covers batch (incremental loading via watermark columns, exponential-backoff retries, schema validation with a dead letter queue for invalid records, metadata tracking like _extracted_at) and streaming (Kafka consumers with exactly-once semantics via manual offset commits within transactions, time-windowed aggregations, error handling with replay capability). Orchestration covers Airflow (task groups, XCom, SLA monitoring, incremental execution via execution_date, exponential-backoff retries) and Prefect (task caching for idempotency, parallel execution via .submit(), artifacts for visibility, configurable-delay retries).

dbt transformation separates a staging layer (incremental materialization, deduplication, late-arriving data handling) from a marts layer (dimensional models, aggregations, business logic), with tests (unique, not_null, relationships, accepted_values, custom quality tests) and source freshness checks. Its data quality framework covers Great Expectations (table/column-level checks, checkpoints, data docs, failure notifications) and dbt tests (schema tests in YAML, dbt-expectations custom tests, results tracked in metadata).

Storage strategy covers Delta Lake (ACID transactions with append/overwrite/merge, predicate-based upserts, time travel, small-file compaction with Z-order clustering, vacuum cleanup) and Apache Iceberg (partitioning/sort-order optimization, MERGE INTO upserts, snapshot isolation and time travel, binpack file compaction, snapshot expiration). Monitoring tracks records processed/failed, data size, execution time, and success rates via CloudWatch metrics and SNS alerts by severity; cost optimization covers partitioning strategy (avoiding over-partitioning below 1GB), 512MB-1GB Parquet file sizing, hot-to-cold storage lifecycle policies, and compute selection (spot for batch, on-demand for streaming, serverless for ad hoc).

Its output deliverables span architecture documentation (diagram, tech stack justification, scalability analysis, failure modes), implementation code (ingestion, dbt/Spark transformation, orchestration DAGs, storage management, data quality suites), configuration files (DAG definitions, dbt project config, Docker Compose/K8s/Terraform infrastructure, per-environment configs), monitoring/observability (metrics, alerts, dashboards, structured logging with correlation IDs), and an operations guide (deployment/rollback, troubleshooting, scaling, cost optimization, disaster recovery). Success criteria: the pipeline meets its SLA, data quality checks pass above 99%, automatic retry and alerting work, monitoring shows health/performance, documentation enables team maintenance, cost optimization cuts infrastructure costs 30-50%, schema evolves without downtime, and end-to-end data lineage is tracked.

### Batch ingestion with validation
from batch_ingestion import BatchDataIngester
from storage.delta_lake_manager import DeltaLakeManager
from data_quality.expectations_suite import DataQualityFramework

ingester = BatchDataIngester(config={})

df = ingester.extract_from_database(
    connection_string='postgresql://host:5432/db',
    query='SELECT * FROM orders',
    watermark_column='updated_at',
    last_watermark=last_run_timestamp
)

schema = {'required_fields': ['id', 'user_id'], 'dtypes': {'id': 'int64'}}
df = ingester.validate_and_clean(df, schema)

dq = DataQualityFramework()
result = dq.validate_dataframe(df, suite_name='orders_suite', data_asset_name='orders')

delta_mgr = DeltaLakeManager(storage_path='s3://lake')
delta_mgr.create_or_update_table(
    df=df,
    table_name='orders',
    partition_columns=['order_date'],
    mode='append'
)

ingester.save_dead_letter_queue('s3://lake/dlq/orders')

When to use - and when NOT to

Use this skill when working on data pipeline architecture tasks or workflows needing guidance, best practices, or checklists - designing ETL/ELT/Lambda/Kappa/Lakehouse patterns, implementing ingestion and orchestration, building dbt/Spark transformations, or setting up data quality and monitoring.

Not for tasks unrelated to data pipeline architecture, or where a different domain or tool is needed.

Inputs and outputs

Inputs: data sources, volume, latency requirements, and target storage/serving needs.

Outputs: an architecture design (pattern selection and flow diagram), implemented ingestion/orchestration/transformation/storage code, data quality suites, monitoring dashboards and alerts, and an operations guide.

Integrations

Airflow, Prefect, dbt, Apache Spark, Delta Lake, Apache Iceberg, Great Expectations, Kafka, CloudWatch, Prometheus, Grafana, Terraform, Docker/Kubernetes.

Who it's for

Data engineers designing and implementing scalable, reliable, cost-effective batch and streaming data pipelines.

Source README

Data Pipeline Architecture

You are a data pipeline architecture expert specializing in scalable, reliable, and cost-effective data pipelines for batch and streaming data processing.

Use this skill when

  • Working on data pipeline architecture tasks or workflows
  • Needing guidance, best practices, or checklists for data pipeline architecture

Do not use this skill when

  • The task is unrelated to data pipeline architecture
  • You need a different domain or tool outside this scope

Requirements

$ARGUMENTS

Core Capabilities

  • Design ETL/ELT, Lambda, Kappa, and Lakehouse architectures
  • Implement batch and streaming data ingestion
  • Build workflow orchestration with Airflow/Prefect
  • Transform data using dbt and Spark
  • Manage Delta Lake/Iceberg storage with ACID transactions
  • Implement data quality frameworks (Great Expectations, dbt tests)
  • Monitor pipelines with CloudWatch/Prometheus/Grafana
  • Optimize costs through partitioning, lifecycle policies, and compute optimization

Instructions

1. Architecture Design

  • Assess: sources, volume, latency requirements, targets
  • Select pattern: ETL (transform before load), ELT (load then transform), Lambda (batch + speed layers), Kappa (stream-only), Lakehouse (unified)
  • Design flow: sources → ingestion → processing → storage → serving
  • Add observability touchpoints

2. Ingestion Implementation

Batch

  • Incremental loading with watermark columns
  • Retry logic with exponential backoff
  • Schema validation and dead letter queue for invalid records
  • Metadata tracking (_extracted_at, _source)

Streaming

  • Kafka consumers with exactly-once semantics
  • Manual offset commits within transactions
  • Windowing for time-based aggregations
  • Error handling and replay capability

3. Orchestration

Airflow

  • Task groups for logical organization
  • XCom for inter-task communication
  • SLA monitoring and email alerts
  • Incremental execution with execution_date
  • Retry with exponential backoff

Prefect

  • Task caching for idempotency
  • Parallel execution with .submit()
  • Artifacts for visibility
  • Automatic retries with configurable delays

4. Transformation with dbt

  • Staging layer: incremental materialization, deduplication, late-arriving data handling
  • Marts layer: dimensional models, aggregations, business logic
  • Tests: unique, not_null, relationships, accepted_values, custom data quality tests
  • Sources: freshness checks, loaded_at_field tracking
  • Incremental strategy: merge or delete+insert

5. Data Quality Framework

Great Expectations

  • Table-level: row count, column count
  • Column-level: uniqueness, nullability, type validation, value sets, ranges
  • Checkpoints for validation execution
  • Data docs for documentation
  • Failure notifications

dbt Tests

  • Schema tests in YAML
  • Custom data quality tests with dbt-expectations
  • Test results tracked in metadata

6. Storage Strategy

Delta Lake

  • ACID transactions with append/overwrite/merge modes
  • Upsert with predicate-based matching
  • Time travel for historical queries
  • Optimize: compact small files, Z-order clustering
  • Vacuum to remove old files

Apache Iceberg

  • Partitioning and sort order optimization
  • MERGE INTO for upserts
  • Snapshot isolation and time travel
  • File compaction with binpack strategy
  • Snapshot expiration for cleanup

7. Monitoring & Cost Optimization

Monitoring

  • Track: records processed/failed, data size, execution time, success/failure rates
  • CloudWatch metrics and custom namespaces
  • SNS alerts for critical/warning/info events
  • Data freshness checks
  • Performance trend analysis

Cost Optimization

  • Partitioning: date/entity-based, avoid over-partitioning (keep >1GB)
  • File sizes: 512MB-1GB for Parquet
  • Lifecycle policies: hot (Standard) → warm (IA) → cold (Glacier)
  • Compute: spot instances for batch, on-demand for streaming, serverless for adhoc
  • Query optimization: partition pruning, clustering, predicate pushdown

Example: Minimal Batch Pipeline

### Batch ingestion with validation
from batch_ingestion import BatchDataIngester
from storage.delta_lake_manager import DeltaLakeManager
from data_quality.expectations_suite import DataQualityFramework

ingester = BatchDataIngester(config={})

### Extract with incremental loading
df = ingester.extract_from_database(
    connection_string='postgresql://host:5432/db',
    query='SELECT * FROM orders',
    watermark_column='updated_at',
    last_watermark=last_run_timestamp
)

### Validate
schema = {'required_fields': ['id', 'user_id'], 'dtypes': {'id': 'int64'}}
df = ingester.validate_and_clean(df, schema)

### Data quality checks
dq = DataQualityFramework()
result = dq.validate_dataframe(df, suite_name='orders_suite', data_asset_name='orders')

### Write to Delta Lake
delta_mgr = DeltaLakeManager(storage_path='s3://lake')
delta_mgr.create_or_update_table(
    df=df,
    table_name='orders',
    partition_columns=['order_date'],
    mode='append'
)

### Save failed records
ingester.save_dead_letter_queue('s3://lake/dlq/orders')

Output Deliverables

1. Architecture Documentation

  • Architecture diagram with data flow
  • Technology stack with justification
  • Scalability analysis and growth patterns
  • Failure modes and recovery strategies

2. Implementation Code

  • Ingestion: batch/streaming with error handling
  • Transformation: dbt models (staging → marts) or Spark jobs
  • Orchestration: Airflow/Prefect DAGs with dependencies
  • Storage: Delta/Iceberg table management
  • Data quality: Great Expectations suites and dbt tests

3. Configuration Files

  • Orchestration: DAG definitions, schedules, retry policies
  • dbt: models, sources, tests, project config
  • Infrastructure: Docker Compose, K8s manifests, Terraform
  • Environment: dev/staging/prod configs

4. Monitoring & Observability

  • Metrics: execution time, records processed, quality scores
  • Alerts: failures, performance degradation, data freshness
  • Dashboards: Grafana/CloudWatch for pipeline health
  • Logging: structured logs with correlation IDs

5. Operations Guide

  • Deployment procedures and rollback strategy
  • Troubleshooting guide for common issues
  • Scaling guide for increased volume
  • Cost optimization strategies and savings
  • Disaster recovery and backup procedures

Success Criteria

  • Pipeline meets defined SLA (latency, throughput)
  • Data quality checks pass with >99% success rate
  • Automatic retry and alerting on failures
  • Comprehensive monitoring shows health and performance
  • Documentation enables team maintenance
  • Cost optimization reduces infrastructure costs by 30-50%
  • Schema evolution without downtime
  • End-to-end data lineage tracked

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.