Data versioning

Also known as: dataset versioning

On this page 7

Data versioning is the practice of recording immutable, addressable snapshots of datasets so that any past state of the data can be identified, retrieved and compared exactly. In MLOps & deployment, it is the counterpart of source control for code: a model is only reproducible when the exact training data version, the code commit and the configuration are all pinned together.

Also called dataset versioning, the practice answers three questions that matter in production machine learning: which data produced this model, what changed between two training runs, and can the earlier state be restored. Without it, model lineage, audits and rollbacks rest on guesswork rather than evidence.

How data versioning identifies and stores dataset states

Data versioning works by giving every dataset state a stable identifier, usually a content hash such as SHA-256 or MD5 computed over the files, and storing the underlying bytes in a way that never overwrites earlier states. The identifier is small enough to commit next to code, while the data itself lives in object storage or a dedicated repository.

Most tools follow a pointer-and-store pattern. A lightweight metadata file records hashes, paths and sizes; a content-addressable cache holds the actual blobs, so identical files across versions are stored only once. This deduplication keeps storage growth proportional to what actually changes rather than to the number of versions.

The table below summarizes the components that appear in nearly every implementation.

ComponentRoleTypical form
Version identifierNames one exact dataset stateContent hash, commit ID or snapshot ID
Metadata recordMaps identifier to files and schemaSmall text file tracked in Git
Object storeHolds immutable data blobsS3, GCS, Azure Blob or local cache
Catalog or logLists versions with time and authorTransaction log or commit history
Access layerRetrieves a version on demandCLI, SDK or time-travel query
Core components of a data versioning system

Approaches to versioning datasets

Teams choose among four broad approaches, and the right one depends on data volume, format and how often records change. File-oriented tools suit images and documents, while table formats with time travel suit large, frequently updated tabular data.

ApproachHow it worksBest fitMain drawback
Full copiesDuplicates the dataset per versionSmall, rarely changing dataStorage grows linearly
Git-linked pointersHashes in Git, blobs in remote storageFiles, images, model inputsWeak for row-level changes
Table time travelTransaction log over Parquet filesLarge analytical tablesRetention limits history
Branching data lakesGit-like branches over object storageMulti-team experimentationExtra infrastructure to run
Main approaches and where each fits

DVC is the best-known example of the Git-linked pointer approach. Delta Lake, Apache Iceberg and Apache Hudi provide snapshot-based time travel on tables, and lakeFS adds branch, commit and merge semantics to an entire object store. Many organizations combine two of these: a table format for raw data and a pointer tool for curated training sets.

Data versioning is one link in the reproducibility chain, and it is often confused with neighboring practices that consume or extend it. The distinctions below clarify what each practice is responsible for.

PracticeWhat it tracksRelationship to data versioning
Code version controlSource files and configurationPinned together with data versions
Model versioningTrained weights and metadataReferences the data version used
Model lineageFull chain from data to deploymentUses data versions as its root nodes
ML metadata storeRuns, parameters and metricsStores data version IDs per run
Feature storeComputed features for training and servingMay version feature definitions and values
How data versioning relates to neighboring concepts

A common misconception is that experiment tracking alone guarantees reproducibility. Logging a dataset path such as a bucket prefix is not enough, because the contents behind that path can change silently. Only an immutable identifier proves that the bytes used yesterday are the bytes available today.

Putting data versioning into practice

Effective adoption starts by deciding what counts as a version. Versioning every raw ingestion batch, every cleaned dataset and every training split gives full traceability but adds storage and operational overhead; most teams version curated training and evaluation sets at minimum and rely on table time travel for raw sources.

  • Pin data and code together in the same commit or pipeline run so a single reference reproduces the model.
  • Version evaluation sets separately from training data, because changing the test set invalidates metric comparisons.
  • Record schema and statistics with each version to make silent changes visible during review.
  • Automate versioning inside pipelines rather than relying on manual commands, which are easily skipped.
  • Define retention rules that keep every version referenced by a deployed or audited model.

In a continuous training setup, each scheduled retraining run should create or reference a new data version automatically. That link enables model rollback with confidence: restoring a previous model also tells the team exactly which data it learned from.

Limitations and common mistakes

Data versioning introduces storage, governance and performance costs that grow with data volume. Privacy law adds a specific tension: an immutable history conflicts with deletion requests, so systems that hold personal data need a documented process for purging or rewriting affected versions.

MistakeSymptomFix
Mutable path referencesRetraining gives different resultsReference content hashes or snapshot IDs
Versioning only raw dataPreprocessing changes go untrackedVersion every curated output
Unbounded retentionStorage costs rise steadilyPrune versions not linked to models
Large files in plain GitSlow clones and bloated repositoriesMove blobs to an external store
No link to personal data rulesDeletion requests cannot be honoredTrack sensitive fields and rewrite versions
Frequent mistakes, their symptoms and fixes

Finally, versioning does not by itself ensure data quality. A perfectly versioned dataset can still contain label errors or data drift relative to production traffic, so versioning should be combined with validation checks and monitoring.

A non-technical view

Think of data versioning as save points for data. A machine learning model learns from a collection of examples. That collection changes over time. New records arrive and old errors get fixed.

Data versioning keeps a labeled copy of each state. Later, anyone can ask which data built a given model. The answer is exact, not a guess. The key benefit is trust: results can be repeated, checked and undone when something goes wrong.

A concrete example

A bank retrains its credit risk model every month on about 40 million loan records. In one month, the new model approves noticeably more risky applicants than the previous version. Because every training run is tied to a specific data snapshot ID, the team compares the two versions directly instead of searching logs.

The comparison shows that an upstream system changed how it encoded missing income values, turning blanks into zeros. The team restores the prior data version, rolls back the model within hours and adds a schema check to the pipeline. When the regulator later asks how the model was built, the bank provides the exact data, code and configuration behind each release.