💾 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 versioning | Consequence |
|---|---|
| “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
| Tool | Approach | Scale | Integration |
|---|---|---|---|
| DVC | Git-like commands for data files | Small-medium | Git repos + remote storage |
| LakeFS | Git-like branching for object stores | Large (S3-native) | S3-compatible API |
| Delta Lake | Versioned table format (Spark) | Very large | Spark/Databricks ecosystem |
| Apache Iceberg | Versioned table format (open) | Very large | Multi-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
| Practice | Why |
|---|---|
| Version data WITH code | Same commit = same data + same processing |
| Immutable datasets | Never modify in place — create new version |
| Meaningful version tags | v2.1-added-math-domain not v2.1 |
| Hash-based dedup | Don’t store duplicate data across versions |
| Automated pipelines | DVC 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