MLOps Architecture: Maturity Levels and Stack Design
Difficulty: Senior Level | Companies: Google, Meta, Netflix, Uber, Stripe
Prerequisites
- !Training and evaluating a model in Python
- !Basic Docker and CI/CD vocabulary
- !Running a web service in a cloud environment
What You'll Learn
- 1Diagnose which maturity level your team actually sits at
- 2Map every pipeline stage to one owning tool and interface
- 3Sequence a platform rollout so each step pays for the next
- 4Recognize the architecture choices that quietly create lock-in
What MLOps actually changes
MLOps is usually introduced as a tooling decision â adopt MLflow, add Kubeflow, stand up a feature store â when the real change is organizational. A model that lives only in a notebook has exactly one owner: whoever ran the cells. The moment a second team depends on that model for revenue, the artifact needs an owner for its training data, an owner for its serving path, and someone accountable for the alert that fires when accuracy decays. MLOps is the set of interfaces that make those handoffs explicit instead of heroic.
Three questions define any MLOps architecture. Where does training data come from, and who vouches for its quality? Which exact code, configuration, and hyperparameters produced the artifact serving traffic right now? What happens the first time that artifact is confidently wrong? If your answers live in Slack threads and a shared drive, you have a process gap rather than a tooling gap. Automation is how you close a gap you already understand; automating an undefined process simply produces failures faster and with more confidence.
The maturity model, level by level
The maturity model earns its keep as a sequencing device, not a scorecard. Each level makes the next one affordable, and skipping one usually means rebuilding later. Level 0 teams train in notebooks and hand off artifacts by email â workable until the person who built the model changes roles. Level 1 adds a repeatable training pipeline plus experiment tracking, so any run can be reconstructed from its recorded parameters. Level 2 layers continuous integration on top: every pull request runs data and model tests, and every merged change can ship without a manual ceremony. Level 3 closes the loop with monitoring and retraining triggers, so the system notices decay before a customer does.
| Level | What becomes automated | Failure it removes | Who owns the model |
|---|---|---|---|
| 0 â Manual | Nothing; notebooks and email handoffs | "It only works on my machine" | The individual author |
| 1 â Pipelines | Training, evaluation, versioning | Which script produced this artifact? | A platform team |
| 2 â CI/CD | Testing and deploying model plus service | Risky, hand-driven releases | Shared on-call rotation |
| 3 â Closed loop | Monitoring, alerts, retraining triggers | Silent quality decay | The service, with human escalation |
Most teams over-rate their level. A retraining job that runs on a schedule but is never inspected is Level 1, not Level 3. The honest audit question is whether you can answer "what data and code produced the model serving right now" in under five minutes from a dashboard, rather than from a colleague's memory.
The eight stages every ML pipeline shares
Frameworks differ, cloud vendors disagree, yet production ML pipelines decompose into the same eight stages: ingestion, validation, feature computation, training, evaluation, registration, deployment, and monitoring. Two properties matter more than the stage names. First, each stage must have a machine-readable input and output contract, because a contract is what lets a stage fail loudly instead of quietly. Second, stages must be idempotent â rerunning ingestion after a partial failure should not double-count rows. Pipelines that violate these properties work perfectly in a demo and become unmaintainable the first time an upstream job lands an hour late.
The registry below encodes those two properties directly: every node declares its dependencies, the graph is validated before execution, and a topological order is derived rather than hardcoded. It is deliberately small â the point is that the shape of your pipeline should be data, not imperative script order buried in a scheduler UI.
# pipeline_graph.py
from dataclasses import dataclass, field
from enum import Enum
from typing import Dict, List
class Stage(Enum):
INGEST = "ingest"
VALIDATE = "validate"
FEATURES = "features"
TRAIN = "train"
EVALUATE = "evaluate"
REGISTER = "register"
DEPLOY = "deploy"
MONITOR = "monitor"
@dataclass
class Node:
name: str
stage: Stage
depends_on: List[str] = field(default_factory=list)
retries: int = 3
timeout_s: int = 3600
class PipelineGraph:
def __init__(self, nodes: List[Node]):
self.nodes: Dict[str, Node] = {n.name: n for n in nodes}
def validate(self) -> List[str]:
errors = []
for node in self.nodes.values():
for dep in node.depends_on:
if dep not in self.nodes:
errors.append(f"{node.name} depends on unknown node {dep}")
if dep == node.name:
errors.append(f"{node.name} depends on itself")
if self._has_cycle():
errors.append("dependency graph contains a cycle")
return errors
def _has_cycle(self) -> bool:
visiting, done = set(), set()
def visit(name: str) -> bool:
if name in done:
return False
if name in visiting:
return True
visiting.add(name)
for dep in self.nodes[name].depends_on:
if visit(dep):
return True
visiting.discard(name)
done.add(name)
return False
return any(visit(n) for n in self.nodes)
def execution_order(self) -> List[str]:
order, seen = [], set()
def walk(name: str):
if name in seen:
return
for dep in self.nodes[name].depends_on:
walk(dep)
seen.add(name)
order.append(name)
for n in self.nodes:
walk(n)
return order
graph = PipelineGraph([
Node("ingest", Stage.INGEST),
Node("validate", Stage.VALIDATE, ["ingest"]),
Node("features", Stage.FEATURES, ["validate"]),
Node("train", Stage.TRAIN, ["features"]),
Node("evaluate", Stage.EVALUATE, ["train"]),
Node("register", Stage.REGISTER, ["evaluate"]),
Node("deploy", Stage.DEPLOY, ["register"]),
Node("monitor", Stage.MONITOR, ["deploy"]),
])
print("errors:", graph.validate())
print("order:", graph.execution_order())
One responsibility per tool
The fastest way to burn a year of platform work is to adopt a suite where a component should be a contract. Each stage above needs exactly one system of record, and everything else should read from it. Experiment tracking owns metrics and parameters. The model registry owns versions and lifecycle state. The feature store owns the training-to-serving parity guarantee. The orchestrator owns scheduling and retries. When two tools both claim ownership of model metadata, engineers eventually discover which one your dashboards trust, and that answer is rarely the one written in the documentation.
| Stage | System of record | Reads from it | Anti-pattern to avoid |
|---|---|---|---|
| Training | Experiment tracker | Orchestrator, review UI | Logging metrics to stdout only |
| Artifacts | Model registry | Serving layer, CI job | Weights dropped in S3 with no index |
| Features | Feature store | Trainer, online predictor | Notebook-computed features at serving time |
| Scheduling | Orchestrator | Alerts, on-call rotation | Cron entries nobody can diff |
| Health | Monitoring stack | Retraining trigger | Per-service metrics with no model labels |
Prefer boring, well-documented interfaces over integrated platforms when you are below Level 2. A small MLflow instance plus a Kubernetes job plus a Prometheus rule you understand will outperform an enterprise suite that nobody on the team can explain during an incident.
Sequencing the first eighteen months
A roadmap that lists every component at once is really a wish list. Sequence by pain instead. Month one and two: one tracked, repeatable training job with metrics and parameters logged, plus a model artifact stored somewhere with a version. Month three to five: a registry with explicit lifecycle states and a serving path that pulls from it, so deployments stop being file copies. Month six to nine: data and model tests wired into CI, and a monitoring dashboard that shows prediction latency, error rate, and input distribution next to each other.
Only after those land should you consider a feature store, distributed training, or automated retraining. Each phase should end with a metric you can show â minutes from merge to deploy, or the share of models with a recorded data version. If a phase produces no measurable change, the next phase inherits the same ambiguity at greater scale.
Where ownership usually breaks down
Architecture diagrams show clean arrows; production shows ownership gaps. The recurring failure is the unowned seam between two teams. Data engineering delivers a table, machine learning trains on it, and platform engineering serves it â but nobody owns the schema change that silently renames a column at 3 a.m. The fix is less about tools than about naming a single accountable owner for each interface and giving that owner a way to fail the pipeline. Contracts enforced at build time are cheaper than postmortems, and they turn an ambiguous cross-team negotiation into a failing test with a clear file to edit.
A second gap appears between training and serving. Feature transformations written in a notebook get reimplemented in SQL or Java for inference, and the two versions drift until precision drops on exactly the slice leadership watches. Treat feature code as a library with one implementation and two callers. The platform investment is modest; the credibility saved during the first model incident is not.
Turning that ownership promise into something enforceable means writing the contract as code that runs in CI, so a breaking change fails a pull request instead of a rollout. The check below is intentionally strict: unknown columns fail loudly, required columns fail when missing, and types are compared rather than assumed. Teams that adopt this pattern report that most cross-team schema arguments disappear, because the conversation moves from a meeting to a diff on a file both sides already own.
# contract_check.py
from dataclasses import dataclass, field
from typing import Dict, List
@dataclass
class ColumnSpec:
name: str
dtype: str
nullable: bool = False
required: bool = True
@dataclass
class DatasetContract:
dataset: str
columns: List[ColumnSpec]
max_rows: int = 10_000_000
def check(self, observed: Dict[str, str], row_count: int) -> List[str]:
errors: List[str] = []
expected = {c.name: c for c in self.columns}
for name, spec in expected.items():
if name not in observed:
if spec.required:
errors.append(f"{self.dataset}: missing required column {name}")
continue
if observed[name] != spec.dtype:
errors.append(
f"{self.dataset}.{name}: expected {spec.dtype}, got {observed[name]}"
)
if not spec.nullable and observed[name].endswith("?"):
errors.append(f"{self.dataset}.{name}: nulls are not allowed")
for name in observed:
if name not in expected:
errors.append(f"{self.dataset}: unexpected column {name} (add it to the spec)")
if row_count == 0:
errors.append(f"{self.dataset}: no rows delivered")
elif row_count > self.max_rows:
errors.append(f"{self.dataset}: {row_count} rows exceeds cap {self.max_rows}")
return errors
contract = DatasetContract(
dataset="customer_features",
columns=[
ColumnSpec("customer_id", "int64", nullable=False),
ColumnSpec("lifetime_value", "float64", nullable=False),
ColumnSpec("segment", "string", nullable=True),
ColumnSpec("total_purchases", "int64", nullable=False),
],
)
observed = {"customer_id": "int64", "lifetime_value": "float64", "segment": "string", "new_col": "int64"}
print(contract.check(observed, row_count=4200))
Signals that the architecture is working
You can measure MLOps maturity without a maturity survey. Track four numbers monthly: median time from a merged change to a production deployment, percentage of production models with a recorded training data version, mean time to detect a quality regression, and the share of retrains that were triggered automatically versus by a person asking in chat. Rising detection time and falling automatic-retrain share are early warnings that your closed loop is quietly becoming a manual process again.
The last signal is cultural. On a healthy platform, a junior engineer can ship a model improvement through the same path a senior engineer uses, and the path is boring. Boring is the goal: architecture earns its keep not during the happy path demo, but during the incident where the on-call engineer needs to answer what changed, when, and how to undo it.
âšī¸Sequencing rule
Common Mistakes
Buying a full MLOps suite before the training step is reproducible
Fix: Make one pipeline stage idempotent and observable first, then add the next tool that removes a real handoff.
Treating the maturity model as a target instead of a sequence
Fix: Pick the lowest level you can prove with evidence, then automate exactly the gap to the next one.
Allowing two systems to both own model metadata
Fix: Declare one system of record per stage and make everything else a read-only consumer.
Measuring success in tools deployed
Fix: Track lead time, data-version coverage, and detection time instead â those reveal whether the tools changed anything.
Best Practices
- Keep the pipeline graph as versioned data so reviews can diff it
- Give every stage a machine-readable contract and a failing test when it breaks
- Document one owner for each interface, named in the repo rather than in a wiki
- Build the monitoring stage before the retraining stage, never the other way around
- Run a game-day where you roll back a model deployment and time the recovery
Interview Questions
Q1: How would you assess a team's MLOps maturity in a single day?
Ask to see the last model change end to end: the training run, its data version, the artifact, the deployment, and the dashboards. Any step that requires a person's memory rather than a link reveals the missing level.
Q2: Monolith versus microservices for an ML platform â what do you weigh?
Team size and change frequency. A small team benefits from one deployable with clear internal boundaries; independent release cadence and per-service scaling justify splitting only once those pressures are real.
Q3: Which component would you build first for a Level 0 team?
Experiment tracking plus a repeatable training job, because every later component â registry, CI, monitoring â reads metadata produced there.
Q4: What security concerns apply to production ML systems?
Artifact provenance, secret handling in training jobs, PII in feature stores, and access control on the serving endpoint are the four that recur in audits.
Key Takeaways
- MLOps is an ownership and contract problem before it is a tooling problem
- The maturity model is a sequencing device: each level funds the next one
- Eight shared stages, each with one system of record and an enforced contract
- Training-to-serving feature parity is the single most expensive seam to leave unowned
- Measure lead time, data-version coverage, and detection time to keep the loop honest