Columnar storage & Parquet

Row groups, column chunks, dictionary/RLE encoding, predicate pushdown via min/max stats. Why analytics scans columns and OLTP reads rows.

About 24 min read3-question knowledge check

The mental model

Parquet is a filing cabinet organised by field, not by folder. A CSV or an OLTP row store is a stack of index cards: to read anyone's phone number you pick up every card, because each card holds a whole person. A columnar file rips those cards apart and files all the names together, all the phone numbers together, all the salaries together. Now "average salary" reads one drawer and never touches the others.

The analogy that sticks: a warehouse with two layouts. Row-major is a warehouse where each pallet holds one complete order — great when a customer walks in wanting their whole order (OLTP: fetch this user's row, update it, write it back). Column-major is a warehouse where each aisle holds one product across all orders — great when you want "how many of product X did we ship this year" and terrible for "give me everything about order 5192". Analytics asks the first kind of question — a few columns across billions of rows — so it stores data the second way.

Why this exists, and the two payoffs that follow from the layout:

  • **You only read the columns you touch.** SELECT revenue FROM sales reads the revenue column chunks and skips 40 other columns on disk. On object storage that is the difference between scanning 8 GB and scanning 200 MB — a direct bill reduction, because engines like Athena and BigQuery charge by bytes scanned.
  • **Homogeneous data compresses far better.** A column of country codes is thousands of repetitions of a few strings; a column of timestamps is nearly sorted integers. Storing like-with-like lets dictionary, run-length and delta encoding shrink it 5–20×, where the same values scattered across rows barely compress at all.

The one idea that explains most Parquet behaviour: **Parquet keeps min/max statistics for every chunk of every column, so a query can skip data it has not read yet.** WHERE event_date = '2026-07-01' can throw away an entire row group after reading 200 bytes of footer metadata — if the data was written in a layout where that filter is selective. That "if" is where most performance wins and losses live.

The full lesson continues with 15 more sections
  • Deep dive
  • Internal architecture
  • Real-world use cases
  • Best practices
  • Common mistakes
  • Performance
  • Security
  • Production troubleshooting
  • Advantages & disadvantages
  • Alternatives
  • Interview expectations
  • Interview questions
  • Facts to remember
  • Cheat sheet
  • Quick revision