Navigation
💾 Data & Storage· 8 min read

Dataset Versioning

DVC, LakeFS, Delta Lake, Iceberg — managing training data with Git-like branching, reproducible experiments, and data diffs.

versioningdvclakefsdelta-lakeicebergreproducibility

Training data changes over time — new sources added, cleaning rules updated, domains rebalanced. Without versioning, you can’t reproduce a training run or debug a regression.


1. Why Version Data

Problem without versioningConsequence
“Which data was model v2.3 trained on?”Can’t reproduce results
“We added toxic data by mistake”Can’t identify which models are affected
“The new cleaning rule broke quality”Can’t roll back to the previous dataset
“Two teams modified the dataset simultaneously”Merge conflicts, data corruption

2. Tools Comparison

ToolApproachScaleIntegration
DVCGit-like commands for data filesSmall-mediumGit repos + remote storage
LakeFSGit-like branching for object storesLarge (S3-native)S3-compatible API
Delta LakeVersioned table format (Spark)Very largeSpark/Databricks ecosystem
Apache IcebergVersioned table format (open)Very largeMulti-engine (Spark, Trino, Flink)

DVC (Simplest)

# Track a dataset with DVC
dvc add training_data/
git add training_data.dvc .gitignore
git commit -m "v1.0 training data: 2B tokens"

# Push data to remote storage
dvc push  # → S3, GCS, or Azure

# Checkout a previous data version
git checkout v1.0
dvc checkout  # restores data files from that version

LakeFS (S3-Native Branching)

# Create a branch for data experiments
lakectl branch create lakefs://repo/experiment-new-filter \
    --source lakefs://repo/main

# Modify data on the branch (any S3 tool works)
aws s3 cp new_data.parquet s3://lakefs/repo/experiment-new-filter/data/

# Compare branches
lakectl diff lakefs://repo/main lakefs://repo/experiment-new-filter

# Merge back to main
lakectl merge lakefs://repo/experiment-new-filter lakefs://repo/main

3. Best Practices

PracticeWhy
Version data WITH codeSame commit = same data + same processing
Immutable datasetsNever modify in place — create new version
Meaningful version tagsv2.1-added-math-domain not v2.1
Hash-based dedupDon’t store duplicate data across versions
Automated pipelinesDVC pipelines or CI/CD trigger on data changes

For tracking which data contributed to which model, see Data Lineage.


Self-Check

  • Explain why dataset versioning is needed for reproducibility
  • Set up DVC to track and version a training dataset
  • Compare DVC vs LakeFS for a 10 TB dataset on S3
  • Design a versioning workflow with branching for data experiments

References