ML Systems Lab Open interactive version →
Intermediate 29 min read model registryMLflowversioningdeployment

Model Registry & Versioning

Artifact storage, metadata, lineage, deployment gating, experiment tracking

Your fraud model was updated four weeks ago. A new fraud pattern shows up and the model is missing it. Now you need answers, fast: when was it updated? What data trained it? What metrics did it hit? Who approved it? Can you roll it back in the next ten minutes? Without a model registry, every one of those is archaeology — digging through Slack, squinting at S3 timestamps, hunting down the engineer who ran the job. And the whole time, the business is eating the cost of a degraded model.


What a registry actually is

It's the governance layer sitting between training and production. It holds the model artifact and its full lineage — the exact dataset (with a content hash), the code commit, the feature versions used, the hyperparameters. It holds deployment history: which version went where, who approved it, what gate it passed. And it holds lifecycle state: Experiment → Staging → Production → Archived.


Weights alone are not the artifact

This is the part teams underbuild. A model trained on scaler-normalized features, deployed *without* that fitted scaler, will get raw inputs, treat them as normalized, and output confident garbage — no error thrown. So the registry must store the *complete inference artifact:* weights plus the fitted preprocessing pipeline plus the feature schema. One load, everything you need.


Experiment tracking is the registry's other job, upstream of deployment

Before a model ever reaches Staging, two data scientists might independently train candidate models with different hyperparameters. Experiment tracking — the piece of the registry that tools like MLflow implement — is what lets them collaborate without a meeting: both log every run's hyperparameters, metrics, and dataset version to the same shared experiment instead of a personal notebook. That experiment shows up in a comparison UI, sortable by any metric (validation AUC, F1, whatever matters for the task), and because each run captured its hyperparameters, metrics, and dataset version together, any run in the list can be reproduced exactly. Pick the winning run by sorting, then register only that one.


A deployment gate is a specific automated check, not a metaphor

"What gate it passed" means a concrete test run at promotion time: a schema-compatibility check (does this version's expected input schema match what the target environment will send it?), a metric threshold (does validation AUC clear the bar the last production model set?), or a required sign-off recorded in the registry. A promotion with no gate is a file copy with delusions of process. A promotion behind a gate is blocked automatically the moment a check fails, before a human has to notice the problem in production.


Multi-environment deployment: config is not weights, and it needs its own versioning

Dev, staging, and prod often run different data schemas — a column added in staging before prod catches up, a mocked field in dev that's real downstream. The fix is to keep environment-specific config (schema mapping, feature-flag state, resource limits) versioned separately from the model weights, and associate the triple (model_version, environment, config_version) at the moment of promotion, not baked in at training time. Every promotion into an environment runs that environment's schema-compatibility gate first, so a mismatch fails loudly at promotion instead of silently at inference.


Rollback is the part that's time-critical

When a model goes bad, you promote the previous version back to Production in a single API call. But only if that artifact still exists — delete it and your "rollback" becomes rebuilding from scratch mid-incident, hours instead of minutes. So never delete production artifacts; a year of storage costs less than one hour of a live incident.

That's the whole difference from "just an S3 folder." Plain storage hands you a file. A registry gives you an approval trail, deployment lineage (what changed between v7 and v8?), instant rollback, and a record of which model made which decision when. A named folder that relies on people staying disciplined under deadline pressure is not a registry — it's a filesystem with good intentions, and it fails you exactly in the first ten minutes of an incident, when you need those answers instantly.

Key points

Takeaway

The three questions that matter during a production incident — what is live, what produced it, what is the rollback target — have no reliable answers without mandatory lineage and programmatic gates enforced by the registry.

Recap

Check your understanding

Q1. Your production model is found to be biased against a demographic group after deployment. Select the two ways the model registry helps you remediate.

Q2. Two data scientists train models independently using different hyperparameters. How does experiment tracking in the registry help them collaborate and pick the best model?

Q3. You need to deploy a model to 3 different environments (dev, staging, prod) with different data schemas in each. How do you design the registry to handle this?

Q4. A model trained 6 months ago is performing better than a newly retrained model on the holdout set. What does this tell you about your data pipeline, and how does the registry help debug it?

Try it interactively

ML Systems Lab is a free interview-prep platform for ML engineers — work through the full interactive module, quizzes, and drills.

Open ML Systems Lab →