Skip to content
XTechStacks TECHNOLOGY · AI · STRATEGY · IMPACT
Menu

MLOps & LLMOps

Data Versioning with DVC: Building Reproducible MLOps Pipelines

Connect Git revisions, DVC artifacts and pipeline dependencies to reproduce experiments and recover approved releases.

Updated

Conceptual illustration for Data Versioning with DVC: Building Reproducible MLOps Pipelines

A model can be reproduced only when its inputs can be recovered. A Git commit identifies training code, but it does not identify a changing export from a warehouse, a replaced CSV file or a model artifact stored on someone’s laptop. Data Version Control (DVC) addresses this gap by linking large artifacts to the small metadata files that Git can manage.

The useful design question is not whether a dataset has a version number. It is whether another engineer can retrieve the same inputs, execute the intended pipeline and explain why the result differs. DVC supports that workflow, but storage permissions, source capture and release discipline remain engineering responsibilities.

Git and DVC manage different parts of a release

Git is well suited to source code, configuration and reviewable text. Putting large datasets or model weights directly into ordinary Git history makes repository operations expensive and retains every committed copy. DVC keeps the artifact outside Git while tracking a small reference to its contents. A .dvc file records tracking metadata; the data itself lives in the local cache and, when configured, remote storage.

A Git revision therefore connects code with an artifact reference. Checking out the code is only part of restoration: the referenced artifact must still exist and the engineer must be authorized to retrieve it. A successful commit does not prove that a remote upload completed.

Architecture of a reproducible pipeline

Separate three layers: source capture, reproducible transformations and release records. Source capture produces a stable input snapshot. Pipeline stages declare dependencies such as source files, scripts and parameters, and outputs such as processed features or trained models. The release record connects the Git revision, artifacts, evaluation results and deployment decision.

DVC pipeline definitions use dvc.yaml; dvc.lock records the resolved state. Treat both as reviewed project files. A dependency that exists only in a notebook cell or an undocumented environment variable is invisible to the declared pipeline and can undermine reproduction.

Git and DVC: references versus artifacts. Git repository: Code, .dvc pointers, dvc.yaml and dvc.lock; DVC cache: Local data and model objects; Authorized remote: Retained objects for sharing and recovery; Pipeline dependencies: Declared inputs, stages and outputs; Run record: Code revision, parameters and metrics; Release record: Approved references and retained artifacts. Git tracks small references; DVC retains the corresponding large objects. Recovery needs both.
Git and DVC: references versus artifacts Git tracks small references; DVC retains the corresponding large objects. Recovery needs both. View full-size diagram

A practical training workflow

Consider a hypothetical support-ticket classifier. The team exports an approved, de-identified training snapshot, prepares text features, trains a candidate and evaluates it on a separate held-out set. The following commands illustrate artifact tracking and sharing; they are not a complete production pipeline or a runtime-verified deployment.

dvc init
dvc add data/tickets.csv
git add data/tickets.csv.dvc data/.gitignore .dvc
git commit -m "Track approved training snapshot"
# Configure an authorized remote separately; keep credentials out of Git.
dvc push

# In another authorized workspace, after checking out that Git revision:
dvc pull

Define preparation, training and evaluation as separate stages rather than one opaque script. Declare the held-out dataset as an evaluation dependency, not a training input. Record the split procedure and random seeds, and pin the software environment. Deterministic artifact references do not make every training operation deterministic, especially across hardware or numerical libraries.

Experiments, parameters and comparisons

DVC experiment management can track parameters, metrics, plots, data dependencies and model artifacts. Compare candidates using the same evaluation dataset and acceptance criteria. A higher aggregate score is not sufficient if a relevant class or operating segment regresses.

Keep the experiment record separate from the approval decision. Record why a candidate was accepted, which evaluation evidence was reviewed and which artifact was promoted. Avoid naming a mutable file best-model.pkl and treating it as the only release identity. A reproducible reference should survive the next experiment.

Team collaboration and CI/CD

Use a shared remote with narrowly scoped access. Separate ordinary contributor access from release or retention administration. CI jobs should retrieve the declared inputs, run checks and publish required artifacts before a release is considered recoverable. Prefer a clean-workspace reproduction test over a test that silently uses a developer’s warm cache.

Concurrent branches can change the same dataset reference. Resolving a text conflict in metadata is not equivalent to merging the actual records correctly. Review the intended source contents, regenerate tracking metadata where needed and rerun the affected stages. Establish ownership for data contracts and approval of changed training populations.

Recover the approved references and artifacts. Select approved revision: Checkout code and DVC metadata; Retrieve retained objects: dvc pull from an authorized remote; Recreate dependencies: Pin the compatible runtime; Run and verify: Reproduce and test the expected output; Approve recovery: Check compatibility before serving; Investigate missing objects: Stop if required artifacts were not retained. The last card is a failure boundary: a Git reference cannot recreate a deleted remote object.
Recover the approved references and artifacts The last card is a failure boundary: a Git reference cannot recreate a deleted remote object. View full-size diagram

Rollback and retention

To investigate an incident, check out the relevant Git revision and retrieve its referenced artifacts. Compare the failing release with the previous accepted one using a fixed evaluation input. Restoring a training snapshot is useful for diagnosis; restoring the deployed service also requires its model, environment and serving configuration.

Retention must match the recovery promise. Garbage collection, object expiration or account closure can remove an artifact while its metadata remains in Git. Document which approved releases are retained, test restoration periodically and account for required data deletion. Reproducibility does not override privacy or retention obligations.

When DVC fits—and when it does not

DVC is a useful choice when a Git-oriented team needs file-based artifact versioning and explicit reproducible pipelines. It adds storage administration, transfer cost and conventions that the team must maintain. It is not a universal substitute for a model registry, streaming platform, warehouse time travel or access-controlled feature serving.

Start with one important pipeline and one restoration test. If the workload already has authoritative snapshot and lineage capabilities, integrate those references rather than copying everything into a parallel store. The objective is a connected, recoverable release—not tool adoption for its own sake.

Key takeaways

  • Commit small metadata with code; keep large artifacts in authorized storage.
  • Declare inputs, transformations, parameters and evaluation dependencies explicitly.
  • Test sharing and restoration without relying on a local cache.
  • Treat artifact retention and approval as part of release engineering.

References

Atul Yadav

Technology architect and founder of XTechStacks, writing about AI, data, cloud, platform engineering and enterprise architecture.

CONTINUE EXPLORING

More engineering insights.

XTECHSTACKS WEEKLY

Stay ahead with practical technical insights.

AI, data, cloud and platform engineering—delivered without the noise.

Working on a similar architecture?
XTechStacks helps teams design, build and operate practical technology solutions.

Talk to Us
A LITTLE CLARITY FOR YOUR INBOX

Make room for useful insight.

Join XTechStacks Weekly for engineering lessons, architecture patterns and thoughtful technology perspectives.

Confirm your subscription by email. Unsubscribe anytime.
We respect your inbox. Privacy policy