Data Lakes, Lakehouses & Batch Processing
Parquet, table formats like Iceberg, partitioning that actually helps, and why the industry converged on "object storage plus metadata" for everything analytical.
#Why not just use a database
An analytical warehouse works well until one of three things happens:
- The data outgrows what you'll pay for. In a traditional warehouse, the machines that store your data are the same machines that query it, so you pay for both together. A petabyte you touch once a quarter costs the same per byte as the table you hit every second.
- The data isn't tabular. Images, audio, model checkpoints, raw JSON, logs. A warehouse will take these grudgingly and expensively.
- Many engines need the same data. SQL, Spark, a training pipeline, and a notebook all want the same table without copying it four times.
The answer the industry converged on is to separate storage from compute and from the table definition:
Any engine can be swapped without moving data. Storage costs cents per gigabyte-month. Compute is rented only while a query runs. That combination is why this architecture won.
#Parquet: why columnar files are so much faster
A Parquet file is split into row groups — horizontal slices of, say, a million rows each. Inside each row group, data is stored column by column, and statistics (min, max, null count) are attached at every level.
PARQUET FILE
├── Row group 1 (~128 MB of rows)
│ ├── Column "user_id" [pages] + min/max/nulls/count
│ ├── Column "country" [pages] + min/max + dictionary
│ └── Column "amount" [pages] + min/max
├── Row group 2 ...
└── Footer: schema + statistics for every column of every row group
Query: SELECT amount FROM t WHERE country = 'IN'
1. Read the footer only (a few KB)
2. Skip every row group whose country min/max excludes 'IN'
3. In surviving groups, read ONLY the country and amount columns
4. Never touch the other 47 columnsThree separate wins compound here:
- Column pruning. Reading 2 of 50 columns reads ~4% of the bytes.
- Predicate pushdown via statistics. Min/max per row group skips whole chunks without decompressing them.
- Compression that actually works. A column holds one type with similar values, so dictionary encoding, run-length encoding, and delta encoding (storing each value as the small difference from the previous one — ideal for sorted timestamps) all apply. 5–10× compression on real data is typical, versus ~2× for row-oriented JSON.
Combined with vectorized execution, this is why a scan over a Parquet dataset can beat a row-store by two orders of magnitude on the same hardware. The mechanism is entirely covered by columnar storage — Parquet is that idea serialised to a file.
#Partitioning: the highest-leverage decision
Partitioning stores rows in different directory paths by column value, so the engine can skip entire directories.
s3://lake/events/
dt=2026-08-01/hour=00/part-0000.parquet
dt=2026-08-01/hour=01/part-0000.parquet
...
WHERE dt = '2026-08-08' → reads 1 day instead of 3 yearsThe rules that matter:
- Partition on what you filter by, almost always time. If most queries are "last 7 days", partitioning by date is the single biggest win available.
- Don't over-partition. Partitioning by
user_idwith 10 million users creates 10 million directories with tiny files in each — you've built the small-file problem deliberately. - Aim for 100 MB – 1 GB per partition. If a day's data is 10 KB, partition by month.
- Beware skew. Partitioning by
countryputs 60% of rows in one directory, and one task processes it while the others idle.
#Table formats: giving a pile of files ACID
A folder full of data files is not a table. Nothing says which files are current, nothing lets you add and remove files as one indivisible change, nothing gives a reader a stable view while a writer is midway through appending, and nothing tracks how the columns have changed over time.
A table format adds a thin layer of bookkeeping on top of those files that supplies exactly those missing pieces — a list of which files make up the table right now, and a rule for swapping that list atomically:
ICEBERG
catalog → current metadata pointer
↓
metadata file (schema, partition spec, snapshot list)
↓
manifest list (which manifests belong to this snapshot)
↓
manifests (which data files, with per-file statistics)
↓
Parquet files
A COMMIT is a single atomic swap of the catalog pointer.
Readers holding the old pointer keep seeing a consistent old snapshot.Read it top to bottom. The catalog is a small service (or database table) that stores one thing per table: which metadata file is current. Everything below it is an immutable file in object storage. A writer adds new Parquet files and new metadata files describing them, then asks the catalog to swap the pointer to the new metadata file — "only if it still points where I last saw it". If another writer got there first, the swap fails and the writer retries. Until the swap, nobody can see the new files.
That one atomic pointer swap delivers:
| Capability | How it works | Why you care |
|---|---|---|
| Atomic commits | Pointer swap; readers never see partial writes | Concurrent readers and writers stop corrupting each other |
| Snapshot isolation | Each reader pins a snapshot for its whole query | A long query gets consistent results while ingest continues |
| Time travel | Old snapshots retained | AS OF '2026-08-01' — reproduce a report or a training set exactly |
| Schema evolution | Columns tracked by ID, not position | Add, drop, rename, reorder without rewriting data |
| Row-level deletes | Delete files or copy-on-write rewrites | GDPR erasure, CDC merge, corrections |
| File pruning | Per-file statistics in the manifests | Skip files without opening them |
The two styles of row-level delete trade write cost for read cost. Copy-on-write rewrites every data file that contains a deleted row — slow to delete, but reads stay simple. Merge-on-read writes a small "delete file" listing which rows are gone, and every reader filters them out on the fly — fast to delete, slightly slower to read until compaction folds the deletes in.
The three contenders — Iceberg, Delta Lake, Hudi — differ less than the discourse suggests. Iceberg has the broadest engine-neutral adoption; Delta is strongest inside the Databricks ecosystem; Hudi was built around incremental upserts and still leads there. For a new project without an existing platform commitment, Iceberg is the safe default.
The formats are also converging:
- Databricks bought Tabular — the company founded by Iceberg's creators — in 2024.
- Delta can publish Iceberg metadata for the same files (UniForm), so one copy of the data is readable as either format.
- Iceberg's v3 spec (2025) adopted Delta-style deletion vectors (a compact bitmap per file marking which rows are deleted) and a semi-structured
varianttype for JSON-like data. - The clouds now sell managed Iceberg tables outright. Amazon S3 Tables (December 2024) runs compaction and snapshot expiry (deleting old snapshots and the files only they referenced) for you — the two maintenance jobs whose neglect is the most common way a lakehouse rots.
The same shape — immutable files plus one atomically swapped pointer — now sits under whole databases, queues and search engines that keep nothing on local disk; see databases on object storage.
#Batch processing over it
With storage solved, batch compute is comparatively simple: read files, transform, write files.
The shuffle is the only part that's hard. Any operation that regroups data by key — join, group-by, sort — requires moving records across the network so that all records with the same key land on the same task.
SHUFFLE
M map tasks partition their output by hash(key) % N
→ written to local disk
N reduce tasks each fetch their partition from every map task
→ M × N network transfers
Costs: disk write + network + disk read + often a sort
→ The shuffle is where batch jobs spend most of their time
and where they fail. Everything else is embarrassingly parallel."Embarrassingly parallel" means each task can work on its own slice of files with no need to talk to any other task — so adding machines speeds it up almost perfectly. The shuffle is the one step where tasks depend on each other.
The two failure modes worth knowing:
- Skew. One key holds 40% of the rows, so one task runs for an hour while 999 finish in a minute. Fixes: salt the hot key — turn
INintoIN#0…IN#9by appending a random suffix, so its rows spread over 10 tasks; aggregate each piece, then combine the 10 partial results in a second, small stage. Or broadcast the small side of the join so there's no shuffle at all. - Spill. A task's partition doesn't fit in memory and goes to disk. Fixes: more partitions, so each is smaller.
Avoid shuffles where you can. A broadcast join — replicating a small table to every task — eliminates the shuffle entirely and is often 10× faster. Pre-partitioning ("bucketing") a table by its join key means a later join can skip the shuffle too.
#Batch, streaming, or both
The old Lambda architecture ran a batch pipeline for correctness and a parallel streaming pipeline for freshness, then merged them at query time. It worked, and it meant writing and maintaining every piece of business logic twice, in two systems, with two sets of bugs.
Kappa proposed one streaming pipeline, with reprocessing done by replaying the log from the beginning. Cleaner in principle; the constraint is that your log must retain enough history to replay, which for years of data means it's really object storage again.
Where it actually landed is neither: one table format, two access patterns. Streaming ingest appends to an Iceberg/Delta table; batch jobs and interactive queries read the same table; a compaction job keeps the file sizes sane; corrections are applied as row-level updates. One copy of the data, one schema, one set of business logic, and freshness measured in minutes rather than hours.
#Check yourself
Name the four layers of a lakehouse.Show answer
What three wins compound in Parquet?Show answer
Why do small files ruin a lakehouse, and what's the fix?Show answer
What are the partitioning rules?Show answer
What is Iceberg's hidden partitioning?Show answer
How does a table format give a pile of files ACID?Show answer
Why does time travel matter?Show answer
Why is the shuffle the hard part of batch jobs, and how do you avoid it?Show answer
#What to carry forward
- Object storage + file format + table format + engine — four independently replaceable layers.
- Parquet wins three ways at once: column pruning, statistics-based skipping, and compression that works because columns are homogeneous.
- Small files are the primary failure mode. Compaction is a required component, not an optimisation.
- Partition on your filter column, usually time. 100 MB – 1 GB per partition; watch for skew.
- Table formats add atomic commits, snapshot isolation, time travel, and schema evolution through one atomic pointer swap.
- The shuffle is where batch jobs spend their time and die. Broadcast joins and pre-bucketing avoid it.