Data and Model Versioning with DVC
DVC keeps large datasets and model files outside Git while Git tracks small files that identify each exact version. This lets a project restore matching code, data, and models without putting large binaries in the Git repository.
itArtificial intelligence and machine learning | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Intro
Data and Model Versioning with DVC
DVC is a command-line tool for versioning large data and model files alongside source code. Git stores small DVC metadata files. A local cache and optional remote storage hold the file contents. A Git revision therefore identifies the code and the DVC metadata needed to recover matching artifacts.
This split addresses a practical mismatch. Git is effective for source code and text review, but large or frequently changing binary files make repository history expensive. Object storage handles large files well, but a bucket path alone does not say which dataset trained a model. DVC connects the two systems without replacing either one.
The three layers
A DVC project has three distinct layers:
- Git metadata layer. Git versions
.dvcfiles,dvc.yaml,dvc.lock, configuration, code, and other small text files. - Workspace and cache layer. The workspace exposes ordinary paths such as
data/train/ormodels/classifier.pkl. DVC stores content-addressed objects in its cache and links or copies the selected objects into those paths. - Remote storage layer. A DVC remote stores cached objects for sharing, backup, and use on another machine. Supported remote types include local filesystems and common object-storage services.
The metadata file is not the data. It records a path, a content hash, and related information. The hash identifies the cached object. Git records changes to that metadata file, so each Git revision can select a different artifact version.
The versioning flow
The core flow begins inside a Git repository. dvc init creates DVC project files. dvc add data/train hashes the target, places its content in the cache, writes data/train.dvc, and arranges for the original path to stay out of Git. You commit the .dvc file and its generated .gitignore entry to Git.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://doc.dvc.org/start
Supports
- DVC architecture across Git metadata, local cache, workspace, and remote storage
- Initialization, add, push, pull, checkout, and version-switching workflow
- Current scope guidance for local Git-based projects versus data-lake workflows
- https://doc.dvc.org/user-guide/project-structure/dvc-files
Supports
- `.dvc` files are YAML placeholders versioned by Git
- Output hashes, paths, descriptions, and optional remote fields
- https://doc.dvc.org/user-guide/data-management/remote-storage
Supports
- DVC remote purpose and supported storage categories
- Repository, local, and credential configuration boundaries
- Multiple and default remote behavior
- https://doc.dvc.org/command-reference
Supports
- Canonical command responsibilities and options
- Typical DVC workflow from initialization through remote sharing
- https://doc.dvc.org/command-reference/add
Supports
- `dvc add` caches a file or directory and writes tracking metadata
- Generated ignore behavior and directory tracking
- https://doc.dvc.org/command-reference/checkout
Supports
- Checkout materializes workspace state from selected metadata and cache objects
- https://doc.dvc.org/command-reference/push
Supports
- Push uploads DVC-tracked objects and does not push Git metadata
- https://doc.dvc.org/command-reference/pull
Supports
- Pull downloads objects and updates workspace paths
- Difference between pull and cache-only fetch
- https://doc.dvc.org/command-reference/status
Supports
- Status reports workspace changes and can compare cache state with remote storage
- https://doc.dvc.org/command-reference/diff
Supports
- Diff reports tracked data changes between Git revisions or workspace state
- https://doc.dvc.org/command-reference/get
Supports
- Get downloads tracked paths without tracking them in the current project
- Revision selection for older dataset or model versions
- https://doc.dvc.org/command-reference/gc
Supports
- Garbage collection removes objects outside the selected revision scope
- Remote cleanup requires explicit retention choices
- https://doc.dvc.org/user-guide/large-dataset-optimization
Supports
- Content-addressed caching, links, and file-level reuse for large datasets
- https://doc.dvc.org/use-cases/data-registry
Supports
- Git and DVC repositories as sources for versioned data and models
- Consumer access through get, import, and APIs
- https://dvc.org/blog/cloud-versioning/
Supports
- Version-aware remote design and cloud version identifiers
- Push-before-commit ordering for version-aware metadata
- February 2023 timeline milestone
- https://dvc.org/blog/june-20-community-gems/
Supports
- Hash-named cache objects, immutability, and file-level deduplication behavior
- https://dvc.org/blog/dvc-3-years-and-1-0-release/
Supports
- May 4, 2017 first DVC blog post
- May 2020 DVC 1.0 prerelease, consolidated pipeline file, run cache, and remote optimizations
- https://dvc.org/blog/dvc-1-0-release/
Supports
- June 22, 2020 DVC 1.0 release and its data, model, pipeline, and remote model
- https://dvc.org/blog/dvc-2-0-release/
Supports
- March 3, 2021 DVC 2.0 release
- Lightweight experiments, model checkpoints, templated pipelines, and DVCLive
- https://dvc.org/blog/introducing-dvc-studio/
Supports
- June 2, 2021 DVC Studio launch and Git-based collaboration model
- https://dvc.org/blog/dvc-vs-code-extension/
Supports
- June 14, 2022 DVC extension launch and dataset, model, experiment, and plot interfaces
- https://dvc.org/blog/dvc-3-0-ml-experiments-data-versioning/
Supports
- June 14, 2023 DVC 3.0 release
- Partial dataset modification, cloud-versioned imports, DVCFileSystem, and transfer improvements
- https://github.com/sindresorhus/awesome
Supports
- Starting index used to discover topic-relevant curated lists
- https://github.com/kelvins/awesome-mlops
Supports
- Discovery of Git LFS, lakeFS, Dolt, and Quilt in the MLOps data-management ecosystem
- Discovery of DVC, DagsHub, and MLflow for the product landscape
- https://git-lfs.com/
Supports
- Git LFS replaces large files in Git with text pointers and stores content separately
- Awesome Links rationale and Landscape placement
- https://github.com/git-lfs/git-lfs/blob/main/docs/spec.md
Supports
- Git LFS pointer-file content identity and object identifier behavior
- https://github.com/iterative/dvc
Supports
- DVC is distributed under the Apache 2.0 license
- DVC Landscape licensing and pricing classification
- https://github.com/git-lfs/git-lfs
Supports
- Git LFS is an open-source command-line extension and specification
- Git LFS Landscape licensing and pricing classification
- https://community.lakefs.io/
Supports
- lakeFS branches, commits, merges, reverts, tags, and zero-copy object-storage model
- Awesome Links rationale and Landscape placement
- https://github.com/treeverse/lakeFS
Supports
- lakeFS is free, open-source, and licensed under Apache 2.0
- lakeFS Landscape licensing and pricing classification
- https://www.dolthub.com/docs/sql-reference/version-control/
Supports
- Dolt commit graph, branches, diffs, merges, and SQL version-control interfaces
- Awesome Links rationale
- https://docs.quilt.bio/
Supports
- Quilt scientific data platform and deeply versioned, context-rich S3 packages
- Awesome Links rationale
- https://dagshub.com/docs/integration_guide/dvc/
Supports
- Managed DVC-compatible storage, tracked-file browsing and diffing, and pipeline visualization
- Local handling of authentication settings
- DagsHub Landscape placement
- https://dagshub.com/pricing
Supports
- DagsHub hosted service offers free and paid plans
- DagsHub Landscape pricing classification
- https://mlflow.org/docs/latest/ml/model-registry/workflow
Supports
- Registered models, model versions, aliases, tags, and source-run details
- MLflow Landscape placement
- https://github.com/mlflow/mlflow
Supports
- MLflow is open-source and licensed under Apache 2.0
- MLflow Landscape licensing and pricing classification
- https://docs.wandb.ai/models/registry/
Supports
- Registry collections, artifact versions, aliases, tags, and search
- Weights & Biases Registry Landscape placement
- https://wandb.ai/site/pricing/
Supports
- Weights & Biases offers free and paid hosted plans
- Weights & Biases Registry Landscape pricing classification
- https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry.html
Supports
- Model groups and versions, metadata, lineage, approval status, deployment, and continuous delivery
- Amazon SageMaker Model Registry Landscape placement
- https://aws.amazon.com/sagemaker/ai/pricing/
Supports
- Amazon SageMaker is a paid managed service
- Amazon SageMaker Model Registry Landscape pricing classification
