Databases Reference/Object Storage & Data Lakes

Parquet & Lake Table Formats

Columnar Parquet file layout (row groups, dictionary encoding), metadata catalogs, and table formats (Iceberg, Delta Lake, Hudi) that add snapshot isolation, schema evolution, and partition pruning over object storage.

4/5Overview: 30m

Why columnar files

Row-oriented DB pages load all columns when you need one. Parquet (and ORC) store data column-by-column in immutable files — ideal for analytics scanning billions of rows × few columns.

Parquet file ├── Row group 1 │ ├── Column chunk: user_id (dictionary + RLE encoded) │ ├── Column chunk: event_type │ └── Column chunk: timestamp ├── Row group 2 └── Footer metadata (statistics, schema)

Parquet storage details

FeatureBenefit
Row groupsParallel read units; predicate pushdown per group
Column statistics (min/max)Skip entire row groups
Dictionary encodingLow-cardinality strings compress heavily
RLE / bit-packingRepetitive numeric sequences shrink

Files are immutable — updates = write new file + mark old invisible in table metadata.

The metadata problem on object storage

A directory of part-0001.parquet files has no ACID, no schema evolution, no snapshot isolation. Table formats add a metadata layer:

FormatMetadata storeNotable features
Apache IcebergManifest files + catalogHidden partitioning, time travel, schema evolution
Delta LakeTransaction log (_delta_log)ACID, Z-order, Databricks integration
Apache HudiTimeline + file groupsIncremental processing, upserts

Iceberg snapshot model

Catalog (Glue, REST) → metadata.json (current schema, partition spec) → manifest list → manifests → data files (Parquet)

Snapshot = consistent view of file set at a point in time. Time travel = read older snapshot. Compaction merges small files — storage maintenance like LSM compaction.

Schema evolution

Add/drop/rename columns in metadata without rewriting all data files (defaults/nulls for old files). Contrast with ALTER TABLE rewriting a B-tree heap.

Partitioning vs bucketing

Partition pruningyear=2024/month=06/ path prefix skips irrelevant objects. Risk: too many small partitions → listing overhead. Iceberg hidden partitioning decouples physical layout from query predicates.

Lakehouse positioning

OLTP stays in Postgres; lake holds historical/analytical data in Parquet + Iceberg; query engines (Trino, Spark SQL, Snowflake external tables) compile SQL to file scans. Storage format choice outlives any single query engine.

Senior-level signal

"CSV on S3" vs "Parquet + Iceberg" — articulate column pruning, compression ratio, and snapshot isolation. That's the storage interview, not the Spark API.

Where this goes next

Elasticsearch & Columnar OLAP — interactive search and sub-second aggregation on columnar layouts.

Further Reading

Hands-On Tasks (Optional)

Low-setup exercises — schema drills, paper walkthroughs, or optional local installs. No autograding; the goal is interview fluency on how data is stored.

  • Explain why Parquet plus Iceberg beats raw CSV on S3

    Name four storage-level benefits: column pruning, compression, schema evolution, and snapshot/time-travel. One sentence each.

    15m