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.
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
How agents, apps and people reach compute: a client session per identity.
Execution
Spark's execution modes, plus engines that read the same tables.
Data foundation
Open tables in a governed catalog, on storage you own.
Operations
Serving
Teams
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
Land bronze once
Each batch is appended to a bronze Iceberg table with a key that makes reruns idempotent.
- 2
Declare silver and gold
A Spark Declarative Pipelines spec declares silver as cleaned bronze and gold as aggregates over silver.
- 3
Spark plans the graph
spark-pipelines run resolves dependencies, creates or updates each table in Unity Catalog and records the run.
- 4
Airflow schedules
An Airflow DAG triggers the pipeline on a schedule and replays past intervals for backfills.
- 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
| Capability | Component | Role in this architecture | Version | License |
|---|---|---|---|---|
| SourcesSource systems | Order-event generator and batch extracts | Daily and hourly files | ||
| IngestionBatch and file ingestion | Idempotent bronze loader | Appends each batch once, keyed so reruns do not duplicate | ||
| IngestionChange data capture | AUTO CDC (Spark Declarative Pipelines) | Applies change feeds as SCD type 1 or 2 | Apache-2.0 | |
| AI and agentsML lifecycle | MLflow | Logs the gold snapshot id with each model run | 3.1.0 | Apache-2.0 |
| ExecutionBatch and SQL | Apache Spark | Runs the pipeline over Spark Connect | 4.3.0 | Apache-2.0 |
| ExecutionDeclarative pipelines | Spark Declarative Pipelines | Declares bronze to silver to gold and resolves order | pyspark[pipelines]==4.3.0 | Apache-2.0 |
| ExecutionOther engines | DuckDBor Trino, PyIceberg | Reads gold through Iceberg REST | 1.5.6 | MIT |
| Data foundationCatalog and credentials | Unity Catalog OSSor Apache Polaris, Lakekeeper, unitycatalog-rs | Writable Iceberg REST catalog | 0.7.0 | Apache-2.0 |
| Data foundationOpen table format | Apache Icebergor Delta Lake, Apache Hudi | Bronze, silver and gold tables | runtime 4.3_2.13 built from apache/iceberg#18749 | Apache-2.0 |
| Data foundationObject storage | SeaweedFSor MinIO, RustFS, Amazon S3, GCS / ADLS | s3://lakehouse/warehouse | 4.51 | Apache-2.0 |
| OperationsOrchestration | Apache Airflowor Dagster, Temporal | DAG with schedules and backfills | 3.3.2 | Apache-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
Chapters 6 to 11 build this pattern: Iceberg through Unity Catalog, idempotent bronze, the SDP medallion, Airflow backfills and DuckDB serving.
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)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.
Related architectures
All architecturesPlatform
The agentic lakehouse
Omnigent and MLflow over sandboxed Spark Connect sessions, on Iceberg and Unity Catalog
Platform
The open lakehouse on a laptop
Spark 4.3, Apache Iceberg, Unity Catalog, Kafka, Airflow, MLflow and an agent, in Docker
Streaming
Streaming medallion
Kafka, Spark Structured Streaming and Apache Iceberg in Unity Catalog
