Columnar storage and the warehouse
Tier 3 taught you how rows are stored and never mentioned the alternative. Here it is, and it is one of the few architectural changes that buys two orders of magnitude rather than a percentage.
Rotate the table
A row store keeps each record's fields together on a page, because when you ask for order 4471 you want all of it:
row store [id=1|cust=A|amt=250|ts=…] [id=2|cust=B|amt=90|ts=…] …
column store id: [1, 2, 3, 4, …]
cust: [A, B, A, C, …]
amt: [250, 90, 410, 75, …]
ts: [… … … …]
A column store keeps each field together. Now "sum the amount over four billion orders" reads one contiguous file and touches nothing else. Three separate wins stack on top of each other, and the stacking is why the number is so large:
- You read only what you touch. A sixty-column table where the query names three reads about 5% of the bytes. Twentyfold, before anything clever happens.
- Compression gets dramatically better. A column holds one type, and usually a narrow range of values — every country code, every status, every timestamp within a day. Dictionary encoding, run-length encoding and delta encoding routinely give 5–20× on real columns, against maybe 2–3× for mixed row data. Multiply it in: another order of magnitude off the bytes read.
- The CPU works in batches. A column is an array of identical values, so the engine processes thousands at a time in vector registers rather than one row through one branchy loop. Same work, a fraction of the instructions.
Notice what the compression is really doing: it converts an I/O problem into a CPU problem. Tier 0's table said reading a megabyte from flash costs about 150 µs and compressing a kilobyte costs about 2 µs. Spending CPU to avoid reading bytes is one of the best trades available in systems, and columnar storage takes it on every query.
What you give up, and it is a lot
This is not a better database. It is a different one, and the losses are structural:
- Single-row updates are terrible. Changing one order means touching sixty separate column files and breaking the compression of every block you land in. Column stores are append-mostly; updates arrive as new versions merged later, which will look familiar from Tier 3's LSM tree.
- Point lookups are slow. "Give me order 4471" reassembles the row from sixty places. The thing your OLTP database does in 100 µs may take a second here.
- Transactions are weaker or absent. Many analytical engines offer no multi-statement transaction at all, and the ones that do bought it recently and at some cost.
Which is the same conclusion as 7.01 from the other direction: the trade is so sharp in both directions that one engine serving both workloads is not a tuning question.
The index equivalent: pruning, not seeking
Scanning is the mode of operation, so the optimisation is not "find the row" but "avoid reading the file at all". Two mechanisms do nearly all the work:
- Partitioning — physically splitting data by a column you always filter on, nearly always the date.
WHERE day >= '2026-07-01'against date-partitioned data skips whole directories without opening them. Get the partition key wrong and every query reads everything; this is the single most consequential layout decision, and it is Tier 4's shard-key choice wearing different clothes. - Column statistics per block. File formats like Parquet store min and max for each column in each row group. A filter on
amount > 10000skips every block whose max is 900 without decompressing it — predicate pushdown, and the reason the file format is an architectural choice rather than a serialisation detail.
Warehouse, lake, lakehouse — the distinction that matters
Three words used loosely enough to be worth pinning down, because the difference is about who owns the files:
- Warehouse — a managed system that owns its storage and its compute. You load data in, it decides the layout, you get SQL, transactions and a query planner. Excellent, and you are inside its walls.
- Lake — files in object storage, in open formats, with no system owning them. Any engine can read them, storage is cheap, and nothing enforces a schema. What that buys in flexibility it removes in guarantees: there is no atomic write across files, so a failed job leaves a half-written table that the next query happily reads.
- Lakehouse — a table format (Iceberg, Delta, Hudi) layered over lake files: a manifest that says which files constitute the table right now. That one indirection restores atomic commits, schema evolution and time travel — reading the table as of last Tuesday — over files that are still open and still yours.
Underneath all three is the shift that actually changed this field: storage and compute separated. Data sits in object storage, costing almost nothing; query engines start, read it, and stop. You stop sizing a cluster for your largest query and start paying per scan, two teams stop contending for one warehouse, and — the part people forget — an idle cluster is now a bill you can end. The cost lever moves from "how big is the machine" to "how many bytes did the query read", which is precisely what partitioning and pruning control.
Pointing the application at the warehouse because it has all the data and speaks SQL. A per-user lookup that your Postgres answers in 200 µs becomes a multi-second scan billed per byte, and a nightly job doing single-row updates rewrites files all night. The warehouse is not a slower database with more history; it is a machine for reading enormous amounts of data at once, and using it for anything else is expensive in both directions at the same time.
The tradeoff sheet
- Problem solved
- Analytical queries scanning billions of rows to aggregate three columns, on an engine that has to read all sixty.
- Rejected, and why
- A read replica moves the load and keeps the layout, so the query is just as slow somewhere else. Materialised views work well until the questions change, which they do.
- The trade
- A second copy of the data, a pipeline that keeps it current, and a lag between the operational truth and the analytical one that someone will eventually be surprised by.
- First to break at 10x
- Freshness expectations before query performance. At 10x the pipeline window stretches, and the dashboard people trust is quietly several hours behind.
- What it does to the bill
- Storage is cheap and compute is charged per query scanned, which inverts the usual instinct — an unpartitioned table makes every careless query expensive.
- Day-2 operations
- Monitor pipeline freshness as an SLO with an owner. Analytical outages are invisible until someone makes a decision on a stale number.