Section A · Orient · Read first

Start Here

A fifteen-chapter reference on the data architecture underneath production machine learning — training data, labels, features, storage, streaming, embeddings, serving, and the operating discipline that keeps them honest. This chapter sets up the running case, defines the ML data plane, and gives you a reading order.

What this guide is (and isn't)

This is a guide about the data architecture that machine learning runs on — the pipelines that assemble training sets without leaking the future, the stores that serve features in single-digit milliseconds, the versioning that lets you reproduce a model six months later, and the monitoring that tells you the world has moved before the model's numbers do. It is written for the engineer who owns that layer: data platform engineers, ML platform engineers, and the senior data engineer who has just been told "the fraud model is wrong and nobody knows why."

It is not a guide to modeling. You will not find loss functions, architectures, or hyperparameter advice here. Models are treated as consumers of data with specific, demanding contracts — and the thesis of the whole guide is that most production ML failures are data-architecture failures wearing a model's clothes: a feature computed one way offline and another way online; a label joined a day too early; a training set that silently drifted from what the API sees; a dataset nobody can rebuild.

It is also not interview prep. That is the sibling guide, ML Data Architecture — Interview Prep, which teaches the same material as a design method with drills and graded answers. Read this one to understand the systems; read that one the week before a loop.

Layered by design

Every chapter opens with foundational framing (what the thing is, why it exists) and climbs to senior design depth (the trade-off table, the schema, the capacity math, the failure story). If you are new, read top to bottom. If you already run a feature store, skim the first section of each chapter and spend your time on the tables and the "when to choose what" heuristics.

The running case: GridDP's four models

Throughout the guide we build the ML data plane for GridDP, the internal data platform of a hypothetical GPU-rental marketplace. It is the same case study as the sibling Data Platform Systems Design guide, and this guide assumes that platform exists: the nine source systems, the telemetry firehose (~17,000 GPUs reporting every 10 seconds, ~150 M samples a day), the canonical model with dim_account, dim_host, fct_rental, fct_bid_event, fct_telemetry_hourly, and the three reference stacks — Stack A (open-source lakehouse: Iceberg, Flink, Feast, MLflow), Stack B (Databricks-centric), Stack C (Snowflake-centric). If those names are unfamiliar, read that guide's Start Here first; it takes ten minutes and everything here builds on it.

GridDP ships four models, and they are chosen because together they exercise every part of the data plane:

ModelPredictsLatency at inferenceWhat it stresses
Marketplace ranking / matchingWhich listings to show a renter, in what order< 50 ms, on every searchOnline feature serving, embeddings, the feedback loop (ranking changes the clicks that train tomorrow's ranker)
Fraud & trustP(fraud) at signup, listing, payment< 100 ms, inline in the requestStreaming features (device/IP velocity), delayed labels (chargebacks arrive weeks later), privacy
Capacity forecastingFree GPU-hours by region and model, next 7 daysBatch, hourlyTime-series from the telemetry firehose, backfills, point-in-time correctness over rollups
Dynamic pricingSuggested on-demand price and expected clearing priceSeconds, per market tickStream–batch consistency, feature freshness SLAs, drift when the market regime changes

Notice the spread: one batch model, one streaming model, two request-path models; labels that arrive instantly (a click) and labels that arrive in six weeks (a chargeback); features from a slowly-changing dimension and features from a firehose. When a chapter says "for the fraud model…", it is picking the case that makes the design tension sharpest.

Illustrative, not official

GridDP and its numbers are teaching fixtures, a composite of how GPU marketplaces behave. Treat the schemas and magnitudes as realistic, not as facts about any company.

The ML data plane: two paths and a loop

Everything in this guide fits one picture. Hold it in your head; every chapter is a zoom into one box.

ml-data-plane.txt
                     ┌────────────────────────── THE LOOP ──────────────────────────┐
                     │                                                               │
  SOURCES            ▼            OFFLINE PATH (hours–days, throughput)              │
  ┌──────────┐   ┌────────┐   ┌──────────┐   ┌───────────┐   ┌──────────┐   ┌────────┐
  │ OLTP/CDC │──▶│ lake-  │──▶│ feature  │──▶│ training  │──▶│ training │──▶│ model  │
  │ events   │   │ house  │   │ pipelines│   │ datasets  │   │  (GPUs)  │   │registry│
  │ telemetry│   │(bronze │   │ (batch)  │   │ point-in- │   └──────────┘   └───┬────┘
  │ 3rd party│   │ silver │   └────┬─────┘   │ time, ver-│                      │ deploy
  └──────────┘   │ gold)  │        │         │ sioned    │                      ▼
       │         └────────┘        │ materialize └───────────┘   ONLINE PATH (ms, latency)
       │ streams                   ▼                              ┌──────────┐   ┌─────────┐
       └──────────────────▶ ┌────────────┐  ◀── streaming ───────│ inference │◀──│ request │
                            │ online     │      features          │ service   │   │ (search,│
                            │ store (KV) │──── feature vector ───▶│ + model   │   │ signup) │
                            └────────────┘                        └────┬──────┘   └─────────┘
                                                                       │ predictions, outcomes
              labels ◀──── ground truth arrives later (clicks, chargebacks, actuals) ◀──┘
              monitoring ◀─ drift, skew, quality — compares offline vs online, then vs now
  • The offline path is optimised for throughput and correctness over time: it turns the lakehouse into versioned training datasets via feature pipelines and point-in-time joins, and feeds GPUs. Chapters 02–05 and 12.
  • The online path is optimised for latency and freshness: it assembles a feature vector for one entity in milliseconds from an online store, sometimes updated by streams seconds ago, and returns a prediction. Chapters 04, 06, 07, 08.
  • The loop is what makes ML data different from analytics data. Predictions change behaviour, behaviour becomes tomorrow's training data, and ground truth for today's predictions arrives later — sometimes much later. Chapters 03, 09, 10.

The single most important property of this picture is the seam between the paths: the same feature must mean the same thing on both. A feature store (ch. 04) is, at bottom, a machine for enforcing that. Training/serving skew — the value computed offline for training disagreeing with the value served online — is the defining bug of the field, and you will meet it in nearly every chapter.

Six principles the guide keeps returning to

  1. Time is the primary key. Every feature value has a validity interval; every training row has a prediction timestamp; a join is only correct if it respects both. "As of when?" is the question behind most bugs.
  2. Datasets are artifacts, not queries. A training set is built, versioned, hashed and registered like a binary — never "the result of running this notebook again."
  3. Define once, serve twice. One feature definition feeds the offline store and the online store. Two implementations is a skew factory.
  4. Labels are data with latency. Ground truth arrives late, partially, and with bias (you only see chargebacks for payments you approved). Model the delay explicitly.
  5. The firehose sets the budget. At GridDP ~80% of bytes are telemetry; the ML plane inherits that 80/20. Rollups, tiering and sampling decisions are cost decisions first.
  6. Reproducibility is a chain, not a tool. Code version + data version + feature definitions + environment. Break one link and you cannot explain a model's behaviour.

How the chapters fit, and reading order

SectionChaptersThe question it answers
A · Orient00, 01What is the ML data plane, and where does it break?
B · The data02 training data · 03 labels · 04 feature store · 05 storage & versioningHow do we build correct, reproducible inputs?
C · Moving & serving06 streaming features · 07 embeddings · 08 servingHow do features reach a model in milliseconds, consistently?
D · Operating it09 lineage · 10 quality & drift · 11 governance · 12 cost & scaleHow do we keep it honest, legal and affordable?
E · Putting it together13 reference architectures · 14 reference design & outlookWhat does the whole thing look like on each stack?

Full read: 00 → 14 in order; the case compounds. "We're standing up a feature store": 01 → 02 → 04 → 08 → 10 → 13. "Our model is wrong and we don't know why": 01 → 02 (leakage) → 09 (can you reproduce it?) → 10 (drift or skew?). "Real-time fraud": 03 → 04 → 06 → 08 → 11.

Optional: how to tell where you are — the answer at four levels
  • L1 · Foundational. Thinks of ML data as "a big CSV of features and a label"; trains from a notebook query; serves by re-running the query at request time or hard-coding the feature logic in the API.
  • L2 · Practitioner. Has an offline feature table and an online cache, knows training/serving skew exists, versions models but not data, discovers leakage after the fact.
  • L3 · Senior. Runs point-in-time joins from a registry of feature definitions, materialises to an online store, versions datasets as artifacts, monitors skew and drift with alerts, reasons about label delay.
  • L4 · Staff. Designs the plane end to end against latency, freshness, cost and compliance budgets; chooses batch vs streaming per feature by SLA; treats the feedback loop and label bias as first-class; can say what to build, what to buy, and the flip condition for each.

Start with the lifecycle and the places it breaks: 01 · The ML Data Lifecycle & Where It Breaks.