Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Git for data, without putting data in Git
Imagine labelling a library’s books by a fingerprint of their contents instead of by title. If two copies are identical they get the same fingerprint, so you only keep one, and a small card in your notebook (“the dataset for experiment 7 is fingerprint 3f9a…”) is enough to get exactly that data back years later. DVC does this: Git stores the small cards, and a cache or cloud bucket stores the data under its fingerprints.
A flight-software ML model or a mission-analysis result must be traceable to the exact telemetry, simulation runs and labels it came from. Versioning data like code makes results reproducible and auditable, and stops “final_v3_really_final.csv”.
- 1. What does Git store when you use DVC?
- 2. Two identical files under content addressing are stored…
- 3. In the demo, an insertion with fixed blocks…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.The DVC workflow
git init && dvc init
dvc add data/telemetry.parquet # → data/telemetry.parquet.dvc (commit to Git); file moved to the cache
git add data/telemetry.parquet.dvc data/.gitignore && git commit -m "Add telemetry v1"
dvc remote add -d storage s3://lab-bucket/dvc
dvc push # upload cache objects the remote lacks
# later, on another machine
git clone … && dvc pull # fetch data for the checked-out commit
git checkout v1.0 && dvc checkout # time-travel data together with codeA .dvc file is small YAML: outs: - md5: 3f9a…, size: 52428800, path: telemetry.parquet. The cache stores the object at .dvc/cache/files/md5/3f/9a…; directories get a .dir manifest listing each file’s hash.
- 1. dvc push uploads…
- 2. To get the data matching an old commit:
- 3. A tracked directory is described by…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 35 minUndergraduate students and practising engineers.Content addressing
An object’s key is a hash of its bytes (MD5 in DVC, SHA-256 in Git LFS and most newer systems). This gives deduplication across files and versions for free, integrity checking on every read, and immutable, cache-friendly storage. Updating a version transfers only objects the other side lacks.
Pipelines
dvc.yaml declares stages (cmd, deps, outs, params, metrics); dvc.lock records the hashes of every dependency and output after a run. dvc repro walks the DAG in topological order and reruns a stage only if its recorded hashes no longer match. If an upstream stage reruns but produces an identical output, downstream stages are skipped. dvc exp run runs parameter variants as lightweight experiments.
stages:
prepare: {cmd: python prepare.py, deps: [raw.csv, prepare.py], outs: [clean.parquet]}
train: {cmd: python train.py, deps: [clean.parquet, train.py], params: [lr, epochs], outs: [model.pt]}
evaluate: {cmd: python eval.py, deps: [model.pt, clean.parquet], metrics: [metrics.json]}- 1. dvc repro reruns a stage when…
- 2. An upstream stage reruns and produces identical output; downstream stages…
- 3. Integrity check on checkout compares…
Level 3: Advanced
★★★★☆ Advanced⏱ 30 minGraduate level, with full derivations and proofs.Choosing a tool
| Tool | Granularity | Strength |
|---|---|---|
| DVC | files and directories, Git-based metadata | ML pipelines, experiments, any storage backend |
| Git LFS | files, pointer files in Git | simple, supported by Git hosts |
| lakeFS | Git-like branches over object storage | atomic commits for data lakes |
| Delta Lake / Apache Iceberg | table snapshots, row-level changes | time travel for Parquet tables (C7.1) |
| Xet, restic, borg | content-defined chunks | deduplicate edits inside large files |
Practices. Version raw data immutably and derive everything else through a pipeline. Pin data versions in experiment tracking (MLflow, W&B) by hash. Keep many small files packed (C4.1, C6.7). Prefer append-friendly formats or partitioned tables for growing data, so new versions add files instead of rewriting them.
- 1. Best fit for versioning a large, growing Parquet table with row updates?
- 2. Why partition growing data into new files?
- 3. Tools that deduplicate edits inside large files use…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.Versioning costs, measured
Exercise 1. Adding a CSV stores it once under files/md5/xx/…; a byte-identical copy adds no object; a corrupted cache object is caught on checkout. A three-file directory with one duplicate is stored as two objects plus a manifest. A second push of the same version sends 0 bytes; adding one 70-byte image sends only it and the new manifest. In the pipeline, appending a row that cleaning removes reruns only prepare; appending a valid row reruns all three stages; deleting metrics.json reruns only evaluate.
Exercise 2: eight versions of a dataset (start: 150 binary files with log-normal sizes, mean about 16 kB, plus a 20 000-row telemetry CSV, 2.7 MB in total). Each update adds 10 files, deletes 3, inserts 100 bytes into 8 files, corrects one CSV value mid-file (changing its length) and appends 1 000 rows. Chunk hashes use SHA-256; CDC uses a Gear rolling hash with 8 KiB average chunks (2–64 KiB).
| Method | Stored after 8 versions | Transfer per update | Objects |
|---|---|---|---|
| full copy per version | 24.97 MB | 3 176 kB | 1 404 |
| file-level content addressing (DVC, Git LFS) | 7.48 MB | 676 kB | 278 |
| fixed 8 KiB blocks | 5.72 MB | 425 kB | 832 |
| content-defined chunks | 4.37 MB | 232 kB | 622 |
The truly new content per update is about 180 kB (ten new files and 1 000 rows). File-level addressing removes the copies of unchanged files (3.3× less storage), but each update still re-sends the whole CSV and every edited file. Fixed blocks dedupe the CSV’s unchanged start, but an insertion shifts every later block. Content-defined chunks realign after edits, so each update transfers within about 30% of the new content (2.9× less than file-level), at the cost of more, smaller objects to index. For tabular data the same effect is usually obtained more simply by appending new Parquet files or using a table format.
Data versioning in AI, robotics and aerospace
- ML datasets and models: DVC or lakeFS for training data, with model registries recording the data hash for each model.
- Robotics logs: large bag and MCAP recordings versioned by content, with curated subsets defined as manifests.
- Mission data: reproducible processing chains (calibration pipelines) where each product records the hashes of its inputs, as in provenance standards like W3C PROV.
- Simulation campaigns: parameter sweeps tracked as experiments with versioned inputs and outputs.
References
- DVC documentation (dvc.org/doc): data management, pipelines, experiments.
- A. Muthitacharoen, B. Chen, D. Mazières (2001). “A low-bandwidth network file system.” SOSP (content-defined chunking with Rabin fingerprints).
- W. Xia et al. (2016). “FastCDC: a fast and efficient content-defined chunking approach for data deduplication.” USENIX ATC.
- M. Armbrust et al. (2020). “Delta Lake: high-performance ACID table storage over cloud object stores.” PVLDB 13(12).
- Git LFS specification (git-lfs.com); lakeFS documentation (docs.lakefs.io).
- M. D. Wilkinson et al. (2016). “The FAIR Guiding Principles for scientific data management and stewardship.” Scientific Data 3, 160018.