◐ ai-teacher

🧱 Foundations · Chapter 1

What Data Engineering Actually Does

Apps create data. Data engineers make that data trustworthy, timely and usable at scale.

Study this lesson free in the app →

The basics

Data engineering is building and running the systems that move data from where it is created to where someone makes a decision with it — reliably, on time and at a sensible cost.

The problem it solves: an app's database is designed to run the business right now — book a ride, take a payment. It is bad at answering "how much did Pune earn last quarter?" and will slow down if you make it try. Someone has to copy, clean and reshape that data into places built for questions, without losing or duplicating any of it.

The mental model: plumbing. Data flows through five stages — source, ingestion, storage, transformation, serving — and the data engineer guarantees it arrives clean, complete and fresh, and notices within minutes when a pipe bursts.

Words you must know 5

Pipeline
an automated path that moves and reshapes data
Data lake
cheap storage that keeps raw data unchanged, forever
Data warehouse
modelled tables built for analytical queries
Freshness
how old the newest row in a table is
Idempotent
a job you can re-run without creating duplicates

Explained

A rider taps Book. In that one second, a payment must not double-charge, a driver must be found, and by tomorrow morning the finance team must be able to say exactly how much the city earned.

One of those is app engineering. The rest is data engineering.

Friday, 9 PM, heavy rain

Thousands of riders open the app at once. Drivers ping their location every few seconds. Requests, payments, cancellations and ratings pour in.

The platform must, at the same moment:

No single database is good at all six. So the work gets split across specialised systems — and the person who designs that split is the data engineer.

In plain words

A data engineer builds the plumbing.

Someone else decides what the water is for. You make sure it arrives — clean, on time, in the right pipe, without leaks, and you know within minutes when a pipe bursts.

The five stages, precisely

Every data platform on earth is some version of this chain:

  1. Source — apps, databases, APIs, devices, files
  2. Ingestion — move data out of the source without hurting it
  3. Storage — a durable, cheap, immutable landing zone (the lake)
  4. Transformation — clean, join, model, aggregate into business meaning
  5. Serving — warehouse tables, dashboards, APIs, ML features

Wrapped around all five: orchestration (what runs when), quality (is it right), observability (do we know when it breaks), and governance (who may see it).

The shape to memorise

apps ──▶ operational DB  (run the business NOW)
  │
  └────▶ event stream ──▶ real-time consumers  (seconds)
              │
              └────▶ raw lake ──▶ transforms ──▶ warehouse ──▶ dashboards / ML
                     (forever)     (minutes-hours)   (answers)

Read it left to right as speed decreasing, meaning increasing. The left is fast and dumb. The right is slow and smart.

Why big platforms look like this

At small scale you can get away with one Postgres and a cron job. It breaks for three reasons, always in this order:

  1. Contention — analytics queries slow down the app that pays the bills
  2. Volume — location pings arrive faster than rows can be indexed
  3. History — the business wants 7 years of facts; the app only wants today's state

Splitting operational from analytical is not architectural fashion. It is what happens after the first outage caused by a dashboard.

OLTP runs the business now. Kafka carries the facts. The lake keeps the history. The warehouse answers the questions.

The mistake beginners make

Pointing the dashboard at the production database.

It works for a month. Then one analyst writes a GROUP BY over 400 million rows on a Friday evening, and bookings start timing out. Now it is an incident, not a query.

Words to know

PipelineAn automated path that moves and reshapes data from source to destination.
IngestionGetting data out of a source system and into your platform.
Data lakeCheap durable storage holding raw, immutable data in its original shape.
Data warehouseA query engine plus modelled tables, optimised for analytical questions.
Serving layerWhere consumers actually read: dashboards, APIs, ML feature stores.
FreshnessHow old the newest data in a table is. The most-watched pipeline metric.

In two minutes

Test yourself

1. A dashboard query is slowing down ride bookings. What is the root cause?

  1. The dashboard SQL is badly written
  2. Analytical and operational workloads share one database
  3. The warehouse is undersized
  4. Too many users opened the dashboard
Show the answer

Analytical and operational workloads share one database — Bad SQL made it visible, but the design flaw is that one system serves both transactions and analytics. Separate them and a bad query costs you a slow dashboard, not lost revenue.

2. Which layer keeps data in its original, unmodified form forever?

  1. The operational database
  2. The raw data lake
  3. The warehouse mart
  4. The BI dashboard
Show the answer

The raw data lake — Raw immutable storage is your undo button. If a transform has a bug, you re-run it from raw. If you overwrote raw, the data is gone.

3. What most separates a senior answer from a junior one when describing your work?

  1. Naming more tools
  2. Talking about the guarantees you provide
  3. Mentioning data volume in terabytes
  4. Listing programming languages
Show the answer

Talking about the guarantees you provide — Tools change every two years. Guarantees — freshness, correctness, recoverability, cost — are what a business actually buys from you.

4. Which is the correct order of the five stages of a data platform?

  1. Ingestion → Source → Storage → Serving → Transformation
  2. Source → Storage → Ingestion → Transformation → Serving
  3. Source → Ingestion → Storage → Transformation → Serving
  4. Source → Transformation → Ingestion → Storage → Serving
Show the answer

Source → Ingestion → Storage → Transformation → Serving — Data is produced at a source, ingested out of it, landed raw in storage, then transformed and served. Transforming before landing raw (the last option) throws away your ability to reprocess.

5. The dashboard says yesterday's revenue was ₹4.1 crore; the payments system says ₹4.3 crore. Which check would have caught this before finance did?

  1. A reconciliation check comparing warehouse totals with the source system
  2. A faster Spark cluster
  3. More filters on the dashboard
  4. Moving the warehouse to another cloud
Show the answer

A reconciliation check comparing warehouse totals with the source system — Reconciliation compares counts and sums between source and destination and alerts on a gap. Speed and tooling don't detect missing rows; only a check against the source does.

6. The warehouse already has clean, modelled tables. Why keep the raw data in the lake as well?

  1. It's only a backup in case the warehouse goes down
  2. Analysts prefer to query raw JSON
  3. The warehouse can't store more than a year
  4. Transformations have bugs and questions change — raw history lets you rebuild any table from scratch
Show the answer

Transformations have bugs and questions change — raw history lets you rebuild any table from scratch — If a transformation was wrong for three months, cleaned tables carry the error; only the untouched raw data lets you replay with fixed logic. 'Backup' is the tempting answer, but the real value is re-processing, not disaster recovery.

There are 8 questions, 3 puzzles and 5 recall cards for this lesson in the app — the recall cards come back on later days, just before you would forget.

Learn it so it stays. Read it, test yourself, then recall it on two different days. The app schedules that for you, free.

Start this lesson →