Incremental ETL over Iceberg & Delta — no cluster

leat

The lakehouse gave us great storage. Running the everyday 90% of ETL still means spinning up a cluster. leat is the missing piece — Kafka-style incremental ETL on one node, for a fraction of the cost, at lower latency.

tests license python
3.3–9.4×fewer CPU-seconds, same output
5·20·50Mleat won wall-clock at every size, equal CPU
~0scold start  ·  Spark pays ~3s

The story

the table is already a log

An Iceberg or Delta table is an append log — every commit is a new snapshot. Add a monotonic offset and "read what changed since last time" becomes "read rows past my last offset." That's a Kafka consumer, except the topic is a table you already have.

So the question that started leat: if the table is already a log, why does every incremental bronze → silver → gold job spin up a distributed engine to process a delta that fits on one core — and pay for it to sit warm between runs? You end up renting a cluster to filter two million rows.

Not a Spark killer. A Spark-is-overkill killer — for the ~90% of ETL that's small, frequent, incremental batches.

Pull that one thread and a pile of ecosystem papercuts come with it: fragile exactly-once, offsets you babysit, streaming jobs you can't scale or deploy, format lock-in, append-only pipelines that shatter the moment data mutates. We set out to fix each one.

What we fixed

problems solved

Every card is a real pain in today's lakehouse-compute stack. The tag says how far we took the fix — everything but "roadmap" ships with a test in the repo.

overkill

Renting a cluster to filter 2M rows

Most medallion ETL is tiny incremental batches — overhead you pay for and never use. leat runs the same transform on one node: same result, far less CPU, scale-to-zero.

measured vs Spark
silent duplicates

Exactly-once that quietly isn't

The offset lives in a separate store; a crash between "data landed" and "offset saved" replays a batch. leat commits the offset inside the sink's own snapshot — it advances iff the data does. One atomic step, no window.

tested
boilerplate

Offsets you have to babysit

Manual offset columns, checkpoint locations, auto.offset.reset. leat gives you Kafka's ergonomics — earliest/latest, seek, lag — but mints and manages the offset for you.

tested
stateful monolith

A streaming job you can't scale or deploy

Spark pins state to one running job — scaling is a resize + restart, no clean blue-green. leat keeps state in the sink, so compute is disposable: scale out = deploy an instance, scale in = remove one; deploy green beside blue.

demonstrated
lock-in

Married to one table format

Pick Iceberg or Delta and your tooling picks a side. leat is format-neutral (both first-class, same code) and catalog-neutral (SQLite, REST, Glue, Unity) — proven live against a REST catalog + object store, with concurrent writers.

proven live
append-only

Great — until your data mutates

Append-only pipelines break when a row updates or a delete lands. leat has an upsert mode (merge-by-key, idempotent) + an on_change guard that surfaces mutations append mode can't see — full CDC/deletes on the roadmap.

upsert tested · CDC next

Receipts: latency

faster to the result

Realistic 2 bronze → 2 silver → 1 gold DAG, both engines pinned to the same 4 CPUs (Docker, matched thread caps). leat wins wall-clock at every size — and starts instantly.

incremental cycle latency — lower is better (ms)

wins 5M · 20M · 50M
leatSpark

And leat is steadier, not just faster on average: at 50M its p95 tail latency is 874 ms vs Spark's 1479 ms (~1.7× tighter). Predictable cycles, not spiky ones.

cold start — time to first result

~0s vs ~3s
leat
~0s (import + connect)
Spark
~3.0s JVM + session, every trigger

For a job that runs every few minutes, that 3-second cold start is the difference between a cluster kept warm 24/7 and a task that starts, runs ~0.4s, and exits.

Receipts: cost & throughput

a fraction of the compute

Gold is byte-for-byte identical on both engines (same sha256, parity-checked). These are the receipts for producing that same result.

CPU-seconds — the bill

~3.3–9.4× less

full backfill — wall-clock (s)

leat faster, all sizes
leatSpark

Where Spark genuinely wins: big shuffles — giant joins that don't fit in memory, global sorts, cross-partition aggregations — need a coordinator moving data around (Spark's real moat, a coordination problem not a size one). For sub-second real-time, use Kafka/Flink. But on data size alone: at 5M, 20M and 50M rows, equal CPU, leat won wall-clock and CPU-seconds every time. (Docker --cpus=4, realistic medallion DAG, single leat instance.)

Operations

scale like a service

Because the offset lives in the sink's commit, a worker holds no durable state — so scaling and deploys stop being cluster surgery.

scale = replica count

Scaling out is deploying another instance; scaling in is removing one. No resize, no restart, no state migration. kubectl scale --replicas=8, and anonymous workers self-distribute the partitions — a dead one's work is reclaimed from the sink offset, exactly-once.

blue-green, not stop-the-world

Deploy a green version to a new sink, parity-check it against blue, flip which one downstream reads. No checkpoint-compatibility landmines, no downtime — the thing Spark streaming makes miserable.

Quickstart

if you know polars

…you know leat. Write a DataFrame; the offset is managed for you.

quickstart.py
# pip install "git+https://github.com/samtheprogrammer/leat.git"
import leat, polars as pl

lt = leat.connect("/data/leat")          # a local warehouse (or point at S3 / a catalog)

# 1) SOURCE table (bronze): write raw rows — leat handles schema + offsets
lt.table("db.events").write(pl.DataFrame({"user_id":[1,2,3], "value":[50,150,250]}))

# 2) a model = read SOURCE db.events  →  write SINK db.silver (auto-created)
@lt.model(source="db.events", sink="db.silver", start="earliest")
def silver(df):                  # df = just your columns, no _offset
    return df.filter(pl.col("value") > 100)

silver.run(once=True)            # incremental, exactly-once (omit once= to loop)

# 3) read the SINK table back
print(lt.table("db.silver").read())  # → the rows with value > 100

Docs, design journal & full benchmark →