Batch · Open reference architecture

Batch medallion with Spark Declarative Pipelines

Spark 4.3, Apache Iceberg and Unity Catalog with bronze, silver and gold

Declare the tables, let Spark work out the order, keep every layer in an open format.

Laptop (Docker)AWSUpdated 2026-11-21

In one paragraph

A batch medallion architecture organizes lakehouse tables into three layers: bronze holds raw records as they arrived, silver holds cleaned and conformed records, and gold holds aggregates shaped for a specific use. In this open reference architecture, Spark Declarative Pipelines (Spark 4.1 and later) defines each layer as a table or materialized view, Spark resolves the dependency graph and runs it, the tables are Apache Iceberg in Unity Catalog OSS 0.7 on S3-compatible storage, Apache Airflow schedules and backfills the runs, and DuckDB reads the gold tables through the catalog's Iceberg REST endpoint.

Batch

Spark 4.3, Apache Iceberg and Unity Catalog with bronze, silver and gold

Sources

Ingestion

Open lakehouse platform

Engine access

Execution

Data foundation

Operations

Serving

Teams

Lit boxes are part of this architecture, with the versions its reference repo pins. Switch to Full platform to see every capability. Select any box or team for details. marks a swappable choice.

When to use it

  • Your sources arrive as files, extracts or database snapshots on a schedule.
  • You want idempotent bronze loads and reproducible silver and gold tables.
  • You want to change a transformation without hand-ordering every downstream job.

When to pick something else

  • Sub-second latency: use the real-time streaming pattern.
  • Teams that need a released Iceberg runtime for Spark 4.3 today: the course builds one from an open Iceberg pull request as a temporary step.

Walkthrough

How data moves through it

  1. 1

    Land bronze once

    Each batch is appended to a bronze Iceberg table with a key that makes reruns idempotent.

  2. 2

    Declare silver and gold

    A Spark Declarative Pipelines spec declares silver as cleaned bronze and gold as aggregates over silver.

  3. 3

    Spark plans the graph

    spark-pipelines run resolves dependencies, creates or updates each table in Unity Catalog and records the run.

  4. 4

    Airflow schedules

    An Airflow DAG triggers the pipeline on a schedule and replays past intervals for backfills.

  5. 5

    Serve from the same tables

    DuckDB attaches the Unity Catalog Iceberg REST endpoint and queries gold without copying it.

Bill of materials

Components and versions

Versions are the ones pinned in the reference repositories below.
CapabilityComponentRole in this architectureVersionLicense
SourcesSource systemsOrder-event generator and batch extractsDaily and hourly files
IngestionBatch and file ingestionIdempotent bronze loaderAppends each batch once, keyed so reruns do not duplicate
IngestionChange data captureAUTO CDC (Spark Declarative Pipelines)Applies change feeds as SCD type 1 or 2Apache-2.0
AI and agentsML lifecycleMLflowLogs the gold snapshot id with each model run3.1.0Apache-2.0
ExecutionBatch and SQLApache SparkRuns the pipeline over Spark Connect4.3.0Apache-2.0
ExecutionDeclarative pipelinesSpark Declarative PipelinesDeclares bronze to silver to gold and resolves orderpyspark[pipelines]==4.3.0Apache-2.0
ExecutionOther enginesDuckDBor Trino, PyIcebergReads gold through Iceberg REST1.5.6MIT
Data foundationCatalog and credentialsUnity Catalog OSSor Apache Polaris, Lakekeeper, unitycatalog-rsWritable Iceberg REST catalog0.7.0Apache-2.0
Data foundationOpen table formatApache Icebergor Delta Lake, Apache HudiBronze, silver and gold tablesruntime 4.3_2.13 built from apache/iceberg#18749Apache-2.0
Data foundationObject storageSeaweedFSor MinIO, RustFS, Amazon S3, GCS / ADLSs3://lakehouse/warehouse4.51Apache-2.0
OperationsOrchestrationApache Airflowor Dagster, TemporalDAG with schedules and backfills3.3.2Apache-2.0

People and agents

Who works with it

Data engineers

Pipelines that are correct, idempotent and cheap to rerun.

Works with: Batch and file ingestion, Change data capture, Batch and SQL, Declarative pipelines, Orchestration, Open table format

AI agents

Tools with clear arguments, a sandbox to write into, fast feedback from dry runs, and version-pinned context.

Works with: Declarative pipelines

ML and AI engineers

Reproducible models, traced and evaluated agents, and a model gateway they control.

Works with: ML lifecycle

Analysts and analytics engineers

One definition of each metric, fast SQL, and dashboards that match.

Works with: Other engines, Batch and SQL

Platform engineers

A platform that is boring to run: deployable from code, observable, with identities for every person, service and agent.

Works with: Object storage, Catalog and credentials

Governance and security

Policies that hold in every engine and for every agent, lineage for audits, and least privilege by default.

Works with: Catalog and credentials

Run it

Reference code

open-lakehouse/lakehouse-masterclassApache-2.0Laptop (Docker)

Chapters 6 to 11 build this pattern: Iceberg through Unity Catalog, idempotent bronze, the SDP medallion, Airflow backfills and DuckDB serving.

open-lakehouse/open-lakehouseApache-2.0Laptop (Docker)AWS

An open reference architecture for the lakehouse that runs on Docker, deploys to AWS, and is designed so an AI agent can set it up and tear it down.

git clone https://github.com/open-lakehouse/open-lakehouse
cd open-lakehouse

cp .env.example .env       # fill in POSTGRES_*, S3_* placeholders
./lakehouse setup          # validate env, install deps, download ~860MB of JARs
./lakehouse start all      # Spark 4.1 master + worker + Connect server + Kafka
./lakehouse start unity-catalog
./lakehouse start mlflow
./lakehouse status --json  # confirm healthy (incl. spark.connect_grpc_listening)
lisancao/spark-demosLaptop (Docker)

Demo 16 includes an AUTO CDC flow that writes SCD type 2 into Iceberg on Spark 4.3.0.

Caveats from the reference repos

  • There is no released Iceberg Spark runtime for Spark 4.3 yet; the course's chapter 5.5 builds it from apache/iceberg#18749 as a temporary step.
  • Unity Catalog 0.7 or later is required for Iceberg writes through its REST catalog.
  • Older SeaweedFS releases have an S3A _temporary rename bug; the course pins 4.51.

Industry lenses

Where this architecture shows up

Each card opens the board with that industry's sources. Full industry pages: Payments and fintech, Healthcare providers, Manufacturing, Energy and utilities.

Answers

Frequently asked questions

What is a medallion architecture?
A layout of lakehouse tables in three layers: bronze for raw data as it arrived, silver for cleaned and conformed data, and gold for aggregates built for a specific consumer.
Do I need Databricks to use declarative pipelines?
No. Spark Declarative Pipelines is part of open source Apache Spark from 4.1, run with the spark-pipelines CLI against a Spark Connect server.
Can DuckDB read tables that Spark writes?
Yes, when both go through the same catalog. In the masterclass, DuckDB attaches Unity Catalog's Iceberg REST endpoint and reads the gold Iceberg tables Spark wrote.