Streaming · Open reference architecture

Streaming medallion

Kafka, Spark Structured Streaming and Apache Iceberg in Unity Catalog

Events in, governed tables out, seconds behind the source.

Laptop (Docker)AWSUpdated 2026-11-21

In one paragraph

A streaming medallion architecture applies the bronze, silver and gold layout to event streams. Apache Kafka buffers events, an Apache Spark Structured Streaming query appends them to a bronze Apache Iceberg table with its checkpoint on object storage, and a Spark Declarative Pipeline derives silver and gold. Because the tables are open and registered in Unity Catalog OSS, batch jobs, other engines and AI agents read the same data the stream writes.

Streaming

Kafka, Spark Structured Streaming and Apache Iceberg in Unity Catalog

Sources

Ingestion

Open lakehouse platform

Engine access

Execution

Data foundation

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

  • Sources emit events continuously and consumers want tables, not topics.
  • Latency of seconds to minutes is enough.
  • You want one copy of history that streaming jobs, batch jobs and agents all read.

When to pick something else

  • Request-path latency in milliseconds: see the real-time streaming architecture.

Walkthrough

How data moves through it

  1. 1

    Buffer events

    Producers write JSON events to a Kafka topic, including resends and late events.

  2. 2

    Append to bronze

    A Structured Streaming query reads Kafka and appends to a bronze Iceberg table; its checkpoint makes the write exactly-once.

  3. 3

    Clean and deduplicate

    Silver handles late and repeated events deterministically.

  4. 4

    Aggregate

    Gold computes the aggregates consumers read.

  5. 5

    Compact

    Streaming writes many small files; a scheduled rewrite_data_files keeps reads fast.

Bill of materials

Components and versions

Versions are the ones pinned in the reference repositories below.
CapabilityComponentRole in this architectureVersionLicense
SourcesSource systemsApplications, devices and CDCEmit events
IngestionEvent streamingApache KafkaDurable event buffer (the orders topic)Confluent 7.5.0 imagesApache-2.0
IngestionChange data captureDebeziumTurns database changes into Kafka eventsApache-2.0
Engine accessSpark Connect sessionsSpark ConnectThe streaming query runs over Spark Connect4.3.0Apache-2.0
ExecutionDeclarative pipelinesSpark Declarative PipelinesSilver and gold derived from bronze4.3.0Apache-2.0
ExecutionStructured StreamingApache Sparkor Apache FlinkKafka to iceberg.bronze.orders_raw, checkpoint at s3a://lakehouse/_checkpoints4.3.0Apache-2.0
Data foundationCatalog and credentialsUnity Catalog OSSor Apache Polaris, LakekeeperIceberg REST catalog for every layer0.7.0Apache-2.0
Data foundationOpen table formatApache Icebergor Delta Lake, Apache HudiBronze, silver and gold tablesApache-2.0
Data foundationObject storageSeaweedFSor RustFS, MinIO, Amazon S3Tables and streaming checkpoints4.51Apache-2.0
OperationsOrchestrationApache AirflowRuns the batch side and table maintenance3.3.2Apache-2.0
OperationsTable maintenanceIceberg maintenance proceduresCompaction keeps small streaming files in checkApache-2.0

People and agents

Who works with it

Data engineers

Pipelines that are correct, idempotent and cheap to rerun.

Works with: Event streaming, Change data capture, Declarative pipelines, Structured Streaming, Orchestration, Table maintenance, 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: Spark Connect sessions, Declarative pipelines

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, Spark Connect sessions

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)

Chapter 9 streams Kafka into iceberg.bronze.orders_raw over Spark Connect; chapter 8 builds silver and gold; chapter 10 adds maintenance.

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

The same flow writing Delta Lake bronze into Unity Catalog 0.6.0.

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)

Caveats from the reference repos

  • Match the Kafka connector to your Spark version exactly; a spark-sql-kafka build for one Spark minor version can fail with NoSuchMethodError on another.
  • Kafka itself is not registered in the catalog; only the tables are.

Industry lenses

Where this architecture shows up

Each card opens the board with that industry's sources. Full industry pages: Payments and fintech, Manufacturing, Retail and e-commerce, Telecommunications, Cybersecurity.

Answers

Frequently asked questions

How do I stream Kafka into Apache Iceberg with open source tools?
Run an Apache Spark Structured Streaming query with the Kafka source and an Iceberg table as the sink, with its checkpoint on object storage, and register the table in an Iceberg REST catalog such as Unity Catalog OSS 0.7 so other engines can read it.
Is the Kafka to Iceberg write exactly-once?
Yes for the table: Structured Streaming records Kafka offsets in its checkpoint and commits each micro-batch atomically, so a restarted query neither skips nor duplicates batches.