5.3.4 · D1MLOps & Deployment

Foundations — Data versioning (DVC)

2,153 words10 min readBack to topic

This page assumes you have read nothing about DVC. Before you can follow the parent note Data versioning (DVC), you need seven building blocks. We build each one from zero: plain words → the picture → why the topic needs it. Each block leans on the one before it.


Block 1 — What is a file really? (bytes)

Look at the top row in the figure: the file is drawn as a strip of little numbered cells. That strip — nothing more — is "the data".

Figure — Data versioning (DVC)

Notice two files can hold the same row of bytes even if they have different names — the name is a label written outside the strip, not part of it. Hold onto that; Block 3 depends on it.


Block 2 — What is a hash? (the fingerprint)

The middle row of the figure shows the byte-strip going into a machine box labelled MD5 and a short code coming out the other side.

Three properties make a hash useful — each shown as a separate mini-panel in the next figure:

Figure — Data versioning (DVC)
  1. Deterministic (left panel): same bytes in → always the same out. Run it a million times, identical answer.
  2. Avalanche (middle panel): change one byte, and changes almost entirely — not by a little, by a lot. There is no "close" — the fingerprint is either identical or wildly different.
  3. Fixed, tiny size (right panel): a 2 GB file and a 3-byte file both produce the same length short code. The fingerprint never grows with the data.

Block 3 — Content addressing (name things by their fingerprint)

In the figure, watch the amber arrow: the byte-strip is filed into a drawer labelled with its hash a1/b2c3..., not with the human name.

Figure — Data versioning (DVC)

Two payoffs fall out for free:

  • Deduplication. If two people add the exact same dataset, both compute the same (deterministic), so it's stored once. The drawer already exists.
  • Automatic version detection. Edit one byte → avalanche → new → a new drawer appears. The old drawer is untouched, so the old version still exists. That is versioning, for free.

Block 4 — The pointer file (the sticky note)

In figure s03, the small card next to the drawer is the pointer: human name on the front, fingerprint written inside telling you which drawer to open.

Recall Check yourself

If two commits contain pointers with the same md5, do they refer to the same data? ::: Yes — same means same byte-strip (Block 2 determinism), so identical data.


Block 5 — What Git already gives us (and what it can't)

Picture a shelf of numbered snapshots; checkout slides you to any one of them and your working folder becomes exactly what it was then.


Block 6 — Remote storage (the garage)

Picture your laptop's local cache as a small drawer and a giant garage across town holding copies. dvc push = truck the drawers to the garage; dvc pull = truck them back.


Block 7 — Reproducibility & the DAG (why we bother)

Figure — Data versioning (DVC)

The figure draws it: a Git commit (bottom) contains the code hash and the data pointer's ; the pointer resolves to the byte-strip in the drawer. One commit pins both — that binding is the parent note's "versioning invariant":


How the blocks feed the topic

Bytes: a file is an ordered row of bytes

Hash: tiny fixed fingerprint of the bytes

Content addressing: store by fingerprint

Pointer file: tiny note holding the hash

Git: versions small files snapshots

Remote storage: cheap warehouse for bytes

Reproducibility and DAG: bind code plus data

DVC: version large data with Git-sized pointers


Equipment checklist

Test yourself — reveal only after answering.

A file, stripped of its name, is fundamentally what?
An ordered row of bytes (numbers 0–255).
What does a hash function output, and does its length depend on file size?
A short fixed-length code ; its length is constant no matter how big the file.
Deterministic property of a hash means?
The same bytes always produce the same .
Avalanche property means?
Changing one byte changes almost entirely — no "small" change.
Content addressing stores/finds a file by its ___ instead of its ___?
By its content hash instead of its name/path.
Two payoffs of content addressing?
Deduplication (same content stored once) and automatic version detection (new content → new hash).
What does a .dvc pointer file contain, and roughly how big is it?
The data's md5 hash, size, and path — about 100 bytes.
What does Git store for every version of a file, and why is that bad for big data?
A full copy of each version in .git/; huge repos and slow clones.
A commit only carries the pointer — where do the actual bytes live until you share them?
In your local cache, until dvc push sends them to the remote.
What is a remote in DVC terms?
Cheap networked object storage (e.g. S3/GCS) keyed by hash/name.
A DAG is?
Boxes joined by one-way arrows with no loops (directed, acyclic).
Reproducibility binds which three things?
Exact code, exact data, exact outputs.

Connections

  • Data versioning (DVC) — the parent topic these foundations unlock.
  • Git version control — versions the small pointer; DVC reuses its content-hashing idea.
  • Content-addressable storage — Block 3, the hashing principle under Git, DVC and Docker.
  • Object storage (S3/GCS) — Block 6, the remote warehouse for heavy bytes.
  • Reproducibility in ML — Block 7, why binding code + data matters.
  • MLOps pipelines — where the dvc.yaml DAG is put to work.
  • Experiment tracking (MLflow) — pairs with DVC on the reproducibility problem.
  • 5.3.04 Data versioning (DVC) (Hinglish) — same material in Hinglish.