TExcelTAD
Home › Data for ML: Types, Formats, Sources & Quality › Data Lakes, Object Storage and Manifests

Data Lakes, Object Storage and Manifests

On a laptop, a dataset is a folder. In a company, the data for ML usually sits in object storage (Amazon S3, Google Cloud Storage, Azure Blob Storage, or self-hosted MinIO), organised as a data lake, and each training set is described by a manifest: a file that lists exactly which objects belong to it. This lesson explains the three ideas and builds a manifest in code.

Object storage

Object storage keeps objects (files of any size) in buckets. Each object has a key, its full name, such as raw/clinic-a/2026/06/img_0001.png, plus metadata and an optional version history. The slashes look like folders, but there are none: a "folder" is just a common prefix of keys, and listing it means asking for all keys that start with it.

File system Object storage
folders and files buckets and keys (prefixes look like folders)
edit a file in place objects are replaced as a whole, not edited
one disk or server practically unlimited, replicated, cheap per GB
open(path) HTTP requests through an API (GET, PUT, LIST), with access rights per bucket or prefix

The key ideas fit in a few lines of Python, with a dictionary standing in for a bucket:

python · try it yourself
bucket = {
    "raw/clinic-a/2026-06-01/img_0001.png": b"...", "raw/clinic-a/2026-06-01/img_0002.png": b"...",
    "raw/clinic-b/2026-06-01/img_0001.png": b"...", "raw/clinic-b/2026-06-02/img_0007.png": b"...",
    "curated/skin-v1/manifest.jsonl": b"...",
}

def list_prefix(bucket, prefix):
    return sorted(k for k in bucket if k.startswith(prefix))

print(list_prefix(bucket, "raw/clinic-b/"))
print(len(list_prefix(bucket, "raw/")), "raw objects")
top = sorted({k.split("/")[0] + "/" for k in bucket})
print("top-level 'folders' (common prefixes):", top)
['raw/clinic-b/2026-06-01/img_0001.png', 'raw/clinic-b/2026-06-02/img_0007.png']
4 raw objects
top-level 'folders' (common prefixes): ['curated/', 'raw/']

Because keys are just strings, a good naming scheme matters more than on a laptop: put the things you filter on (source, date) early in the key, and never encode information that might change (a label) in the key.

The data lake

A data lake stores data of every kind (tables, logs, images, audio) in its raw form, cheaply, and in one place, usually object storage with Parquet for tables. A lake without rules becomes a "data swamp" that nobody can find anything in, so lakes are organised in zones:

rawas receivednever changed cleanedvalidated, Parquetpersonal data removed curateddatasets per taskmanifests, versions to training
  • Raw keeps the data exactly as it arrived, read-only. If a cleaning step has a bug, you can always rerun it from raw.
  • Cleaned (also "silver") holds validated data in standard formats, with obvious errors fixed and personal data removed or pseudonymised.
  • Curated (also "gold") holds datasets built for a purpose, such as "skin lesion classifier, version 3", each described by a manifest.

A catalog (AWS Glue, Unity Catalog, Hive Metastore, or simply a well-kept README) records what each dataset is, its schema, owner, licence and who may read it. A lakehouse adds table formats such as Delta Lake or Apache Iceberg on top of Parquet, which bring updates, schema checks and time travel (reading a table as it was last month).

Manifests

A manifest is the list of samples in a dataset, one entry per sample, with everything needed to load and audit it. A typical JSONL manifest line:

json
{"key": "raw/clinic-a/2026-06-01/img_0001.png", "label": "benign", "split": "train", "sha256": "3f2a…", "bytes": 48213, "source": "clinic-a", "licence": "internal-consented"}

With a manifest, the dataset is no longer "whatever happens to be in the folder today". The same objects can be part of several datasets, a training run can record which manifest it used, and anyone can check that the files have not changed since. Building and checking one:

python · try it yourself
import hashlib
import json
import os
import tempfile

root = tempfile.mkdtemp()
files = {"a/img_1.png": b"pixels-1", "a/img_2.png": b"pixels-2", "b/img_3.png": b"pixels-3"}
labels = {"a/img_1.png": "benign", "a/img_2.png": "malignant", "b/img_3.png": "benign"}
for key, data in files.items():
    os.makedirs(os.path.join(root, os.path.dirname(key)), exist_ok=True)
    with open(os.path.join(root, key), "wb") as fh:
        fh.write(data)

def sha256(path):
    with open(path, "rb") as fh:
        return hashlib.sha256(fh.read()).hexdigest()

manifest = [{"key": k, "label": labels[k], "source": k.split("/")[0],
             "bytes": os.path.getsize(os.path.join(root, k)), "sha256": sha256(os.path.join(root, k))[:16]}
            for k in sorted(files)]
text = "\n".join(json.dumps(m) for m in manifest)
print(text)

# Later: someone overwrites one file and deletes another.
with open(os.path.join(root, "a/img_2.png"), "wb") as fh:
    fh.write(b"pixels-2-edited")
os.remove(os.path.join(root, "b/img_3.png"))

print()
for m in map(json.loads, text.splitlines()):
    path = os.path.join(root, m["key"])
    if not os.path.exists(path):
        print(m["key"], "MISSING")
    elif sha256(path)[:16] != m["sha256"]:
        print(m["key"], "CHANGED")
    else:
        print(m["key"], "ok")
{"key": "a/img_1.png", "label": "benign", "source": "a", "bytes": 8, "sha256": "8974e19269065fdf"}
{"key": "a/img_2.png", "label": "malignant", "source": "a", "bytes": 8, "sha256": "1b6c0da563c2e116"}
{"key": "b/img_3.png", "label": "benign", "source": "b", "bytes": 8, "sha256": "105fe8a8de9606b7"}

a/img_1.png ok
a/img_2.png CHANGED
b/img_3.png MISSING

The check takes a few lines and catches the two things that silently break reproducibility: files that disappeared and files that changed. (The example shortens the hashes to 16 characters to fit the page; keep the full 64 in practice.)

Pitfalls

  • Labels in keys: renaming or moving an object to relabel it breaks every manifest that points to it. Keep labels in the manifest or a label table.
  • Mutable "latest" folders: training on curated/latest/ makes results impossible to reproduce. Train on a fixed, versioned manifest.
  • Public buckets: a bucket opened to the internet by mistake is one of the most common causes of data leaks. Default to private and grant the least access needed.
  • Raw data that gets edited: keep raw read-only, so that every cleaned dataset can be rebuilt.

Practice

  1. Design a key scheme for dash-cam videos from 200 vehicles, collected daily, that makes "all videos of vehicle 17 in June 2026" one prefix listing.
Answer

raw/dashcam/vehicle=017/2026/06/14/clip_000123.mp4 (vehicle first, then year, month, day). The prefix raw/dashcam/vehicle=017/2026/06/ lists exactly the requested clips. Zero-padding the vehicle number keeps the keys sorted.

  1. A colleague fixed 40 wrong labels by moving image files to other class folders in the bucket. What went wrong, and what would have been better?
Answer

Moving objects changed their keys, so every existing manifest now points to missing files and earlier experiments can no longer be reproduced; the fix also leaves no record of what changed. Better: keep the images where they are and publish a new manifest (or label table) version with the corrected labels and a note of the 40 changes.

Test yourself

In object storage, what is a 'folder'?

  1. A real directory on a disk
  2. A common prefix of object keys
  3. A separate bucket
  4. A manifest file

Why is the raw zone of a data lake kept read-only?

  1. Raw data is too big to change
  2. So that every later dataset can be rebuilt from the original data if a processing step was wrong
  3. Object storage cannot be written
  4. To save money

What does a manifest record for each sample?

  1. Only the model's prediction
  2. Its location, label, split and a checksum, plus source and licence
  3. The training loss
  4. The bucket's access rights