Engineering notes / Part 1 · Storage

Container images are not filesystems.
We stopped pretending they were.

A container image is an immutable, versioned graph — not a directory tree. Changing the primary storage model changes snapshots, deduplication, and distribution.

For a long time, I optimized OverlayFS.

Mount performance. Copy-on-write. Layer deduplication. Snapshot management. I got good at it. I could explain why a particular mount was slow, and usually make it faster.

Then I asked a question I couldn’t un-ask: why is container storage a filesystem problem at all?

The question I couldn’t un-ask

Container images are immutable. They are versioned. They are shared across machines and referenced by digest. They are moved, cached, and deduplicated.

That is not really a filesystem. That is a graph of immutable data.

Filesystems are optimized for mutation: create, write, rename, delete, own, permission, mount. A container image mostly does none of that. It gets built once, addressed by content, and read many times. The filesystem abstraction is still useful at the execution boundary — a process needs files — but it is a poor primary model for the image itself.

What the filesystem model is actually good at

I want to be careful here, because “filesystems are wrong” is a bad argument.

Filesystems have decades of optimization and an enormous ecosystem. Every tool understands a path. Every debugger, every backup agent, every security scanner, every kernel interface is built around files. OverlayFS made containers practical because it let a read-only image become a writable root in a way that the kernel already understood.

That is a real advantage. It is not a reason to make the filesystem the source of truth.

The model we chose

In Pullrun, OCI content is stored as a content-addressed DAG. A hash identifies content, not a path. Layers are nodes. Manifests reference other nodes. The image is a graph, and the graph is the identity.

The store does not extract layers into an overlay directory. It keeps content as-is, addressed by hash, and materializes a per-workload rootfs view at execution time. OverlayFS can still appear as a confined runtime view, but it is no longer the store.

That sounds like an implementation detail. It isn’t.

What changes

  • Snapshots become references to a state. A snapshot does not need to copy a filesystem tree to describe it.
  • Rollback becomes following references. The old state still exists if the content still exists.
  • Deduplication comes from identity. Two workloads sharing a layer share the content, not a copied directory.
  • Sharing becomes natural. If two machines need the same bytes, they can identify them by the same hash.
  • Storage starts to look like networking. Once content is immutable and addressable, distribution becomes a set problem.

That last point is the one that surprised me. I started thinking about storage and ended up thinking about distribution. If a peer can describe what it has as a set of hashes, another peer can compute the difference. A registry stops being the only path for every byte.

The trade-off

A DAG is less familiar than a filesystem.

Existing tools do not understand it. Operators cannot ls their way through it. Debugging requires new mental models. The abstraction has to earn its complexity every day, and there are cases where a plain filesystem is the right answer.

Filesystems also benefit from decades of hardening. Replacing the primary model means taking responsibility for garbage collection, integrity, concurrency, and failure modes that the kernel used to own.

This is not a free win. It is a trade.

The open question

The interesting question is not “can we replace filesystems?”

It is: where does a content-addressed model make enough sense that the trade-off is worth taking?

For immutable OCI images, I think the answer is clearly yes. For a database, probably not. For a build cache, maybe. The boundary is the interesting part.

Part 1 of a series. Next: if two nodes already store the same content, why is a registry involved in every pull? Read Part 2 →

StorageDAGRustOpen source
All writing ↗

Run the runtime, not another stack.

Install Pullrun ↗
Mohammed Boukaba

AI infrastructure and systems engineer. Creator of Pullrun and Rune. Rust, Go, Firecracker, Kubernetes.

GitHub ↗