ADR 0005: Implement a VFS Overlay (IVirtualFileSystem) on Top of IStorage

Status

Accepted — 2025-12-15

Context

Most object-storage providers do not have “real directories”; they have key prefixes, but many apps still need a file/directory API that works consistently on top of any configured IStorage.

Problem

If we extend IStorage with a full directory/file API:

Decision

We keep IStorage as the provider-agnostic blob abstraction and implement a separate overlay package:

flowchart TD
  Caller --> VFS[IVirtualFileSystem]
  VFS --> VF[IVirtualFile / IVirtualDirectory]
  VF --> S[IStorage]
  S --> Provider[Concrete provider]

Alternatives Considered

  1. Add directory/file methods to IStorage
    • Pros: one API for everything.
    • Cons: bloats core; forces all providers to model higher-level semantics.
  2. Provider-specific directory APIs
    • Pros: can be “native” where the provider supports it.
    • Cons: inconsistent across providers; consumers lose portability.
  3. Overlay VFS (chosen)
    • Pros: portable; optional; keeps core small.
    • Cons: directory semantics rely on listing/prefix conventions and may be slower without caching.

Consequences

Positive

Negative

References (Internal)