Reference · print-friendly

OPFS decision playbook

One page for design reviews. Walk top to bottom; stop when a row rejects the current candidate.

1. Gate A · Job (which store?)

If… Prefer…
Re-fetch is cheap; no offline need Memory only (skip durable client store)
Tiny string flags sessionStorage / localStorage (sparingly)
HTTP assets / app shell / resource responses Cache Storage (+ usually a service worker)
Durable structured app data (drafts, entities) IndexedDB
File-shaped private pipelines (media, exports, DB files) OPFS
User must open/save real OS paths File System Access pickers (user-visible FS)
Multi-device source of truth Server + explicit sync — not OPFS alone

2. Gate B · Tree shape (if OPFS)

3. Gate C · I/O path

4. Gate D · Ship risks

5. Sentence template

“We use OPFS | IndexedDB | Cache | pickers | memory | server because job; tree is folder layout + handles; I/O is writable streams | worker sync access; we own one risk (quota / lock / re-hydrate / private-vs-UVFS).”