Module 22 of 52 · Engineering and platforms

Architectures and pipelines

30 min 4 outcomes Interactive ETL/ELT animator + drag challenge 6 sources cited

By the end of this module you will be able to:

  • Distinguish ETL from ELT and explain when each is appropriate
  • Compare batch and streaming processing for a given latency requirement
  • Describe the key architectural difference between a data warehouse and a data lake
  • Identify the role of each component in a modern data stack

Pipeline as a chain of contracts from source to serve

Only the rows the validate stage approves travel on to transform and serve, and the rejected ones go to quarantine with a reason and re-enter validate after repair, so a failure holds data back rather than losing it quietly.

A pipeline is a chain of explicit contracts, not a flat sequence of scripts. Source, ingest, validate, transform, serve each carry their own contract; failures route to quarantine and replay back into validate. Databricks' medallion pattern has three layers, not five stages: bronze holds what ingest lands raw, silver the validated and cleaned data, and gold the enriched tables that are served.

Pipeline as a chain of explicit contracts from source to serve One row of five cards across the top: Source, Ingest, Validate, Transform, Serve, joined left to right by red arrows whose labels sit above the row and read extract, land raw, approved rows, published contract. Validate is emphasised in pale red with a red border; the other four are white with a grey border. Each card carries its stage number, heading, body line and source tag. Beneath Validate, two red legs close a loop: one drops into a grey Quarantine card holding rejected rows with reason, labelled route to quarantine, and a second rises back into Validate, labelled re-enter validate after repair. A red band closes the figure with the cost of leaving the loop out. Five explicit contracts, and a quarantine loop back into validate1SourceSystem, file, eventODCS v3.12IngestCapture rawpayloadDatabricks Bronze3ValidateSchema, quality,freshnessUK GDQF4TransformClean, join, modelDatabricks Silver5ServeAPI, dataset,reportDatabricks Goldextractland rawapproved rowspublished contractQuarantineRejected rows, with reasonroute to quarantinere-enter validate after repairQuarantine and replay close the loopPipelines without this loop silently lose data.

Four named pipeline failure modes with four actions

Each of the four modes carries its own action, reject and alert, hold and repair, refresh, or notify the consumer, making the name you give the failure the thing that stops a quality miss being discarded as schema drift.

Pipeline failures have four named modes: schema drift, quality miss, freshness miss, and downstream contract break. Each has a different action: reject + alert, hold + repair, refresh, notify consumer. Naming the mode turns vague pipeline-broken alerts into specific actions.

Pipeline failure modes classified into four named actions Four parallel columns, side by side with no arrow between them, because the four modes are alternatives rather than steps. The top card of each column names the failure mode and its source: Schema drift and Contract break from ODCS, Quality miss and Freshness miss from the UK Government Data Quality Framework. A short red arrow drops from each mode card into the action card below it, which carries the label Action and then the action itself: reject and alert producer, hold and repair, refresh and reschedule, notify consumer. The Quality miss column is emphasised in pale red with a red border. A red band closes the figure with the cost of naming the mode wrongly. Four named failure modes, each with its own named actionSchema driftODCS v3.1Quality missUK GDQFFreshness missUK GDQFContract breakODCS v3.1Actionreject + alert producerActionhold + repairActionrefresh + rescheduleActionnotify consumerMisclassification has a direct costA quality miss treated as schema drift discards repairable rows. A freshness miss treated as a contract break burns consumertrust. Name the mode first.

In 2016 Netflix handled about 500 billion events a day. Not all of them needed the same speed.

In February 2016 Netflix reported that its data pipeline handled about 500 billion events and 1.3 PB of data a day. Events entered through Kafka, and a routing service sent them on to S3 for Hive batch jobs, which usually scan data daily or hourly, and to Elasticsearch or a second Kafka cluster for real-time use.

The architecture choice determines what is possible. The Foundations stage covered what data is and how to judge its quality, and the Modelling and statistics stage covered how to structure and analyse it. This module opens Stage 3, Engineering and platforms, by examining how data moves through systems at scale.

Some questions about those events can wait for an hourly batch; others need what happened in the last minute. How does one pipeline serve both?

A data pipeline is a sequence of automated processes that moves data from source systems to a destination, applying transformations along the way. Every pipeline must answer three questions: where does the data come from, what processing is required, and where does it need to go?

The first architecture decision is where transformation should happen.

12.1 ETL versus ELT

ETL (Extract, Transform, Load) transforms data outside the destination in a separate processing layer, then loads clean data. ELT (Extract, Load, Transform) loads raw data first, then transforms inside the destination using its compute power.

ETL dominated when warehouse compute was expensive. ELT became more common because cloud warehouses like BigQuery, Snowflake, and Redshift offer elastic compute that makes in-warehouse transformation faster and cheaper than external processing. dbt (data build tool) is a widely used ELT transformation tool, using SQL models versioned in Git.

Data architecture defines the blueprint for managing data assets by aligning with organisational strategy to establish strategic data requirements and designs to meet those requirements.
Paraphrased from DAMA-DMBOK2 (2017) - Chapter 4, Data Architecture

DAMA frames architecture as strategy-driven, not technology-driven. The choice between ETL and ELT, batch and streaming, warehouse and lakehouse all depend on what the organisation needs from its data, not on which technology is newest.

Common misconception

“ELT is always better than ETL because it uses the warehouse's compute.”

ELT is more efficient when the destination has elastic compute (cloud warehouses). But ETL remains appropriate when the transformation needs libraries the destination cannot host (some Python ML or geospatial packages), when data must be cleansed before entering a regulated destination, or when the destination has limited compute capacity. The choice is architectural, not dogmatic.

The next decision is how fresh the data must be for the decision it supports.

12.2 Batch versus streaming

Batch processing collects data over a period (hourly, daily, weekly), then processes it all at once. Streaming processing handles data continuously as it arrives, event by event. The trade-off is latency versus complexity.

Batch is simpler, cheaper, and sufficient for many analytical workloads. Streaming is necessary when decisions depend on fresh data: fraud detection where seconds matter, recommendation engines where the next suggestion must appear before the user leaves, and operations centres monitoring live systems.

Apache Kafka is a widely deployed streaming platform. It handles event ingestion at millions of events per second. Apache Flink and Spark Structured Streaming process those events with transformations and aggregations.

“Processing real time streaming data requires throughput scalability, reliability, high availability, and low latency to support a variety of applications and workloads.”

AWS Well-Architected Framework, Data Analytics Lens - Streaming ingest and stream processing

AWS's guidance makes the trade-off explicit. Streaming is an operating capability with reliability, scalability, and latency obligations, not just a faster version of batch.

Storage architecture then decides what structure, governance, and engines the platform can support.

12.3 Warehouse, lake, and lakehouse

A data warehouse (Snowflake, BigQuery, Redshift) stores structured, schema-enforced data optimised for SQL analytics. It provides fast query performance but requires data to be modelled before loading.

A data lake (S3, Azure Data Lake, GCS) stores raw data in any format: structured, semi-structured, and unstructured. It provides flexibility but risks becoming a "data swamp" without governance, cataloguing, and quality controls.

A data lakehouse pattern (Databricks Lakehouse, Apache Iceberg, Delta Lake) combines both: open file formats stored in a lake with warehouse-like features (ACID transactions, schema enforcement, time-travel queries). The lakehouse pattern emerged around 2020 as a major modern architecture for organisations that need both analytical and machine learning workloads.

Common misconception

“A data lake is just a cheap data warehouse.”

A data lake stores raw files in any format, including images, log files and sensor dumps that a warehouse is not built to hold. Warehouses do store semi-structured data such as JSON (Snowflake's VARIANT type, for example), so the key difference is schema enforcement: warehouses usually enforce schema-on-write for their tables (define the structure before loading), while lakes allow schema-on-read (interpret the structure when querying). A lakehouse adds warehouse-like governance to lake storage.

Loading interactive component...
Loading interactive component...
12.4 Check your understanding

A fintech startup uses BigQuery as its data warehouse. Raw transaction data lands in BigQuery via Fivetran connectors. A data engineer writes SQL transformations in dbt to create analytics-ready tables. Which pipeline pattern is this?

A logistics company needs to calculate optimal delivery routes. Route calculations require Python geospatial libraries (not SQL). The results feed into an operational database. Should this use ETL or ELT?

A bank runs nightly batch pipelines for regulatory reporting. The CFO asks whether switching to streaming would improve report accuracy. What is the best response?

Loading interactive component...
Loading interactive component...
Check your understanding

A retail company loads daily sales CSVs into a data warehouse using an ETL process. They want to add real-time inventory updates. Which architecture change is most appropriate?

Architecture checks to carry forward

  • ETL transforms before loading. ELT loads first and transforms in the destination. The right choice depends on regulation, tooling, compute location, cost, and workload.
  • Batch handles scheduled chunks. Streaming handles events as they arrive. Streaming needs reliability, availability, throughput, latency controls, and stronger operational discipline.
  • Warehouses optimise governed SQL analytics. Lakes store varied raw data with schema-on-read. Lakehouse table formats add transactions, schema evolution, and time travel to lake storage.
  • A production stack needs observability across ingestion, storage, transformation, serving, and quality. Monitoring is part of the architecture, not an afterthought.
  • Architecture choices should start from latency, scale, cost, risk, and decision need. Technology trends are not requirements.

Standards and sources cited in this module

  1. DAMA-DMBOK2 Revised (2024) (print edition; the link is DAMA's publisher page, not the chapter text)

    Data Architecture knowledge area

    Defines data architecture as strategy-driven, not technology-driven. Provides the conceptual framework for pipeline and storage architecture decisions.

  2. AWS Well-Architected Framework, Data Analytics Lens

    Batch and streaming data processing

    Industry guidance on batch processing, streaming processing, reliability, latency, and workload trade-offs.

  3. Databricks, 'Lakehouse: A New Generation of Open Platforms' (2021)

    Full paper

    Academic paper introducing the lakehouse architecture combining lake storage flexibility with warehouse-like governance.

  4. Apache Iceberg

    Project overview

    Open table format reference for schema evolution, time travel, and reliability features in lakehouse-style architectures.

  5. dbt Labs, 'What is dbt?' (2024)

    Documentation

    dbt is a widely used ELT transformation tool. Used in the terminal simulation and referenced throughout the ELT discussion.

  6. Netflix Technology Blog, 'Evolution of the Netflix Data Pipeline' (2016)

    Full post

    Source for the 2016 figure of about 500 billion events and 1.3 PB a day, and for the Kafka-fronted pipeline that routes events to S3 for Hive batch jobs and to Elasticsearch for real-time use in the opening case study.

Build it in the workspace

The artefact this module describes, as something you can fill in.

Module 22 of 52 · Engineering and platforms