← Back to Index

5. Core Components

Production ML systems are built from reusable components. Mastering each component's design considerations is essential.

Feature Store

A centralized repository for features shared across training and serving.

Model Registry

A versioned catalog of models with metadata:

Inference API

The interface between the ML system and its consumers.

# Inference API design
POST /predict
{
  "features": {"amount": 299.99, "merchant_id": "amzn", ...},
  "request_id": "req_abc",
  "model_version": "v3.2"  # optional, defaults to champion
}

Response:
{
  "prediction": 0.12,
  "model_version": "v3.2",
  "latency_ms": 142,
  "explanation": {"amount": 0.05, "merchant_risk": 0.07}
}

Feedback Loop

The mechanism for collecting ground truth and improving the system over time.

# Feedback store schema
request_id (PK) | features | prediction | ground_truth | label_time
req_abc         | {...}    | 0.12       | 0.0          | 2026-06-15T10:35:00Z
req_def         | {...}    | 0.87       | 1.0          | 2026-06-15T11:00:00Z
Exercise: Design the core components for an ML system that predicts customer churn. Specify: a) what features go in the feature store, b) what metadata the model registry should store, c) the inference API request/response format, d) how the feedback loop collects churn labels (which may take 30+ days to confirm).