Book Deep-Read · Fundamentals of Data Engineering · Chapter 8

Queries, Modeling, and Transformation

Fundamentals of Data Engineering · Ch 8 · Queries, Modeling, and Transformation · Reis & Housley · 2022

中文 →

What is this chapter about?

The previous chapter moved orders, payments and clicks into the company's data warehouse. But what arrives is raw material, like crates just unloaded in a supermarket's back room. This chapter is about turning raw material into goods on the shelf: how to ask questions (queries), how to agree on the rules (modeling), and how to prepare the data (transformation). This is where data starts to earn its keep.

A strange thing first

The boss asks "how much did we sell last month?" Marketing reports one number, finance another, a few percent apart. Nobody made an arithmetic error: marketing counted returned orders, finance counted only money that actually arrived. When numbers disagree, it is usually not a calculation mistake but different ideas of what "an order" is. The most important job in this chapter is pinning those words down first.

Why the old world was hard

How it works, intuitively

What it gives us / how to choose

Most teams first agree with the business on what the key terms mean, organize data as "ledger plus registers", and keep the preparation steps as code that can be rerun and managed in one place; only where answers are truly needed within seconds do they compute directly on the stream. One honest cost: agreeing definitions and building models up front takes real time and conversation. Skipping it gets the first report out sooner, but you pay it back twice over in every meeting spent arguing about numbers.

One line to remember

Data creates value not when it lands but when it is prepared: query by reading less, model by fixing definitions and keeping history, and transform with recipes you can rerun.

Want the life of a query, column and partition pruning, the three stream windows and watermarks, normalization, the four modeling schools (Inmon, Kimball, Data Vault, wide tables), slowly changing dimensions, the cost of distributed joins and upserts, plus evidence from dbt, Trino and Flink? → Switch to Deep