Analytics: Columns, Object Storage, Table Formats

OLTP vs analytics — same SQL, different internals

AspectOLTPAnalytics (data warehouse)
Query patternSingle-row lookups, small writesFull-table scans, aggregations
Optimization targetTransaction processingQuery performance at scale
InterfaceSQLSQL
Internalscompletely different

HTAP (hybrid transactional/analytical) systems — SQL Server, SAP HANA, SingleStore — historically bolted two storage engines together. The modern pattern is two decoupled engines behind a common SQL interface, each optimized independently.

Cloud warehouses vs traditional

Traditional (on-premises)

Teradata, Vertica, SAP HANA. Fixed infrastructure; storage and compute tightly coupled — you scale one by scaling both.

Cloud-native (decoupled)

BigQuery, Redshift, Snowflake. Storage and compute scale independently; object storage as a cheap elastic layer; serverless pay-per-query compute; native integration with cloud streaming services.

The modern analytics stack, in four layers

The modern analytics stack as four stacked layers. At the bottom, layer 1, object storage holds Parquet or ORC files and answers how rows become bytes. Layer 2, the table format, Iceberg or Delta metadata, answers which files are the table right now. Layer 3, the data catalog, Polaris, Unity or the Iceberg REST catalog, answers which tables exist and who may read them. Layer 4, the query engines Trino, Presto, Spark and DuckDB, turn SQL into execution. Every engine reaches the same tables through the same catalog.
Four layers, four separate products — and any engine can read the same tables
  • 1. Storage format — how rows become bytes: Parquet (columnar, dominant), ORC (Hive's), Lance (vector-search optimized), Nimble. Key property: persisted in object storage, readable by any engine.
  • 2. Table format — immutability + ACID over those files. See below.
  • 3. Data catalog — metadata and governance: which files/tables belong to a database; create/rename/drop; a standalone service with a REST API, not embedded in the engine. Snowflake Polaris, Databricks Unity Catalog, Iceberg REST Catalog. Decoupling it is what lets discovery tools inspect metadata, governance systems enforce policy, and multiple engines query the same tables.
  • 4. Query engine — SQL → execution: Trino, Presto, Apache DataFusion. Parse and optimize SQL, execute as parallel distributed tasks, optionally on external executors (Spark, Flink).

Why a table format is needed at all

A raw folder of Parquet files cannot answer: which of these files are current? what did this table look like yesterday? if two writers add files simultaneously, who wins? which old files are safe to delete?

A table directory, /data/customers/. Its data folder holds three immutable Parquet files, part-001 to part-003. Its metadata folder holds v1.metadata.json, the table state as of 2026-04-09, and v2.metadata.json, the state as of 2026-04-10. The catalog points at v2, which makes it the current version. No data file is ever rewritten in place; the table changes by writing a new metadata version.
A folder of immutable files, plus the metadata that says which ones are the table

The table format is the metadata layer that answers them — tracking "what is the table right now" without ever mutating the underlying files.

Inserts are easy; deletes are where it gets interesting

✗ Copy-on-Write (default for batch)

"Delete customer #5" — who lives in part-001:
  1. Read all of part-001 (1,000 rows)
  2. Rewrite as part-001-v2 (999 rows)
  3. metadata → [part-001-v2, part-002, ...]
  4. part-001 stays until garbage collected

Reads fast (clean files).
Writes expensive — one deleted row
rewrites an entire file.

✓ Merge-on-Read (default for streaming)

"Delete customer #5":
  1. Write a tiny delete file:
     deletes-001.parquet  [customer_id=5]
  2. metadata → [part-001 + deletes-001, ...]

At query time:
  read part-001, apply deletes-001
  → #5 filtered out on the fly

Writes cheap. Reads pay the cost, and
delete files must be compacted back in.

Either way, files are never mutated in place. Only the metadata pointer changes.

CapabilityHow it works
ACID transactionsOptimistic concurrency: two writers both try to write v3; first commit wins, the loser detects the conflict and retries against v3. Both writes succeed, in sequence, with no data loss.
Time travelEvery metadata version is retained until garbage-collected. SELECT * FROM customers AS OF '2026-04-09' resolves to the v1 snapshot and reads only the files v1 listed. Files added later are invisible.
Schema evolutionSchema is tracked per snapshot, not baked into files. Old files stay readable with the new column reading null; new files include it; column mapping is resolved per-file.
Garbage collectionFiles referenced only by expired snapshots can be deleted — after checking no live snapshot still references them.

What's actually inside the metadata

Not one flat file — a hierarchy of small ones:

The table-format metadata as a tree of small files, read left to right. metadata.json, about 1 KB, is the current pointer; it records snapshots v1, v2 and v3, and v3 is current. Snapshot v3 names one manifest list, about 100 KB, holding the paths of the manifest files. Each manifest, such as manifest-001.avro, catalogues Parquet files: for part-001.parquet it records 1,000 rows, 128 MB, and min and max customer_id 1 to 1000.
The metadata is a tree of small files — each level names the next

Each manifest is a catalogue of Parquet files. Per file it stores:

manifest-001.avro  entry for part-001.parquet:
  file_path:      s3://bucket/customers/part-001.parquet
  record_count:   1,000
  file_size:      128 MB
  column_stats:
    customer_id:  min=1,          max=1000
    signup_date:  min=2024-01-01, max=2024-06-30
    country:      min="AU",       max="US"
  partition:      {year=2024, month=01}
  status:         ADDED  (or DELETED if this file was removed)

Those min/max/row-count statistics are written when the Parquet file is created. They cost nothing at query time because they were computed once, during the write.

How this scales to thousands of files

The naive fear: 10,000 Parquet files → every query opens 10,000 files. What actually happens is that the engine reads the metadata hierarchy first and uses statistics to eliminate files before touching them.

SELECT * FROM customers WHERE customer_id = 5500

Step 1 — read metadata.json (1 KB, one HTTP request) → points to snapshot-v3

Step 2 — read manifest-list.avro (100 KB, one request) → 200 manifest files

Step 3 — scan manifests in memory (no data reads):
  manifest-001: customer_id [1–1000]     → 5500 outside range → SKIP
  manifest-002: customer_id [1001–2000]  → SKIP
  ...
  manifest-055: customer_id [5001–6000]  → in range → OPEN these files
  manifest-056: customer_id [6001–7000]  → SKIP
  ...

Step 4 — open 2–3 Parquet files (out of 10,000), read only the column
         stripes the query needs, return matching rows.

The 9,997 files that can't contain #5500 are never opened. This is file pruning, or predicate pushdown into metadata. Two mechanisms work together:

MechanismHowEliminates
Partition pruningFiles organized by partition (e.g. date); a query on one date skips all other partitions entirelyEntire partitions
Min/max statisticsEach manifest entry records column min/max; if a file's customer_id max is 1000, skip it for 5500Individual files within a partition

What keeps the metadata itself from bloating? Two compaction processes — and note how exactly they rhyme with the Compaction strategies part:

Data file compaction:
  1,000 × 10 MB files → 10 × 1 GB files
  Fewer files = fewer manifest entries = faster metadata scans
  Also improves read throughput (sequential scan of fewer, larger files)

Metadata compaction:
  Periodic rewrite of manifests to drop references to deleted/expired files
  Keeps manifest size proportional to LIVE file count, not historical count

Data compaction in Iceberg/Delta plays exactly the same role as compaction in an LSM tree (see Compaction strategies): convert many small immutable files into fewer large ones, keeping both reads and metadata management efficient. Same problem, same solution, three orders of magnitude apart in file size.

The Invariants

  • Guarantees: Atomic table-level commits over a store that offers no multi-file atomicity, plus point-in-time reads of any retained snapshot — without ever mutating a data file.
  • Does not guarantee: That reads stay fast as files accumulate. Metadata scan cost grows with live file count, and merge-on-read delete files must be compacted back in — both are background jobs that can fall behind, exactly as LSM compaction can.