DVC, short for Data Version Control, is an open-source command-line tool that brings Git-style versioning to datasets, trained models and machine learning pipelines by storing small metadata files in Git while the large files live in external storage. In MLOps & deployment, it is one of the most widely used building blocks for data versioning and ML reproducibility, because it ties every model artifact to the exact code, data and parameters that produced it.
DVC does not replace Git; it extends it. A repository that uses DVC remains an ordinary Git repository, and the content-addressed cache that DVC manages makes it possible to check out any historical commit and recover the matching data and model files with a single command.
How DVC tracks data next to Git
DVC works by replacing large files with pointer files that Git can version cheaply. When a user runs dvc add data/images, DVC computes a content hash (MD5) of the file or directory, moves the content into a local cache under .dvc/cache, and writes a small .dvc file that records the hash, size and path. Git then tracks only that pointer file.
The actual bytes are synchronized with a DVC remote, which can be object storage, a network share or an SSH server. Because the cache is content-addressed, identical files are stored once, and switching branches only changes links in the workspace instead of copying gigabytes. The dvc checkout command restores the workspace to whatever hashes the current Git commit references.
The table below summarizes the main components a practitioner meets in a DVC project.
| Component | What it stores | Versioned by |
|---|---|---|
| .dvc pointer file | Hash, size and path of tracked data | Git |
| dvc.yaml | Pipeline stages, commands, dependencies and outputs | Git |
| dvc.lock | Exact hashes of every stage input and output | Git |
| params.yaml | Hyperparameters and configuration values | Git |
| Local cache | Content-addressed copies of data and models | DVC |
| Remote storage | Shared cache for the team and CI runners | DVC |
Pipelines, parameters and experiments in DVC
Beyond file versioning, DVC defines reproducible pipelines as a directed acyclic graph of stages in dvc.yaml. Each stage declares its command, its dependencies (code, data, parameters) and its outputs. Running dvc repro re-executes only the stages whose inputs changed, which gives the training pipeline make-like incremental behavior.
After each run, dvc.lock records the hashes of all inputs and outputs, so the combination of a Git commit and its lock file forms a complete lineage record. Metrics files and plots declared in the pipeline can be compared across commits with dvc metrics diff and dvc plots diff, which supports model promotion decisions based on evidence rather than memory.
The experiment management layer, invoked through dvc exp run, lets practitioners try parameter variations without creating a Git commit for every attempt. Experiments are stored as hidden Git references, can be queued and run in parallel, and only the winning variant needs to be promoted to a branch.
The following table maps everyday tasks to the commands that perform them.
| Task | Command | Effect |
|---|---|---|
| Start tracking data | dvc add | Creates a pointer file and caches content |
| Share data with the team | dvc push | Uploads cached objects to the remote |
| Fetch data for a commit | dvc pull | Downloads and links required objects |
| Rebuild changed stages | dvc repro | Runs only stages with modified inputs |
| Try a parameter variant | dvc exp run -S lr=0.01 | Runs an experiment without a commit |
| Compare results | dvc metrics diff | Shows metric changes between revisions |
How DVC compares with related MLOps tools
DVC occupies a narrow but foundational layer: it versions files and pipeline lineage, while other tools handle orchestration, serving or metadata at scale. Confusion usually arises with Git LFS, experiment trackers and workflow frameworks, all of which overlap with part of what DVC does.
| Tool or approach | Primary focus | Key difference from DVC |
|---|---|---|
| Git LFS | Large files inside Git hosting | No pipelines, metrics or flexible remotes |
| Experiment tracker | Logging runs, metrics and charts | Server-based; does not version raw data |
| Kedro or Metaflow | Pipeline code structure and execution | Orchestrates code; data versioning is secondary |
| Feature store (Feast) | Serving consistent features online | Manages feature values, not file snapshots |
| ML metadata store | Central lineage database | Queryable service rather than Git files |
In practice, teams often combine DVC with an experiment tracker for rich dashboards and with an orchestrator such as Kubeflow for scheduled continuous training. DVC remains the source of truth for which data snapshot produced which model.
Choosing a storage and team setup for DVC
A successful DVC deployment depends mostly on remote storage choice and on clear conventions for when data is pushed. The decision table below reflects common configurations and why teams choose them.
| Situation | Recommended setup | Reason |
|---|---|---|
| Solo researcher | Local or network-drive remote | Simple, no cloud credentials needed |
| Cloud-based team | Object storage bucket as remote | Scales well and integrates with CI runners |
| Very large shared datasets | Shared cache on a common file system | Avoids duplicating terabytes per user |
| Regulated environment | On-premises remote with access control | Keeps data under internal governance |
| CI/CD for ML | Pull data in CI, run dvc repro | Verifies that results reproduce automatically |
A sound rule is to push data before pushing the Git commit that references it. Otherwise a colleague can pull a commit whose pointer files reference objects that do not yet exist on the remote, which produces missing cache errors.
Limitations and common mistakes with DVC
DVC is file-oriented, so it fits snapshot-style datasets far better than continuously changing databases or streaming tables. Versioning a database requires exporting snapshots first, and tracking millions of small files can make hashing and transfer slow unless data is packed into larger archives.
- Committing data directly to Git by forgetting
dvc add, which bloats repository history permanently. - Forgetting `dvc push`, leaving teammates and CI pipelines unable to retrieve data.
- Undeclared dependencies in
dvc.yaml, which makedvc reproskip stages that should rerun. - Treating DVC as a model registry without adding stage tags, approvals or serving metadata.
- Ignoring cache growth, since unused objects stay until
dvc gccleans them up.
Teams should also remember that DVC records what was used, not whether data is correct. Data validation, drift detection and quality checks still belong in dedicated steps of the pipeline.
In plain words
Git keeps a history of code, but it struggles with huge files. DVC solves that problem. It keeps a small label for each big file in Git. The big file itself goes to a separate storage place.
Think of a library catalog. The catalog card is small and easy to copy. The book sits on a shelf elsewhere. DVC writes the cards, and Git keeps every version of them. Any old version of the data can return when needed, together with the code that used it.
A real-world example
A medical imaging team trains a model that detects fractures in X-ray images. Its dataset holds about 180,000 labeled images, roughly 400 GB, and radiologists correct labels every few weeks. The team tracks the image folder and label file with DVC and stores the cache in a private object storage bucket.
When a new model version shows lower recall on wrist fractures, an engineer checks out the commit of the previous release and runs dvc pull. Within an hour, the team has both datasets side by side. A diff shows that a relabeling batch changed 2,300 wrist images. The team reviews those labels, fixes 140 errors, and runs dvc repro. The retrained model recovers its recall, and the full lineage is kept for the audit trail that the hospital requires.