Skip to content

Writing

Notes on browser storage

What actually happens when you put a database in a browser tab — the constraints the platform imposes, the failures that do not announce themselves, and the measurements behind the claims.

10 posts

  1. 7 min read

    How to benchmark browser storage without fooling yourself

    How to benchmark IndexedDB and SQLite WASM in the browser: measure p95 and p99, test on a slow device, assert ratios rather than millisecond thresholds.

    • performance
    • testing
    • IndexedDB
  2. 8 min read

    Browser storage eviction: quota, Safari, and the rebuild path

    How browser storage eviction actually works — quota, navigator.storage.persist(), Safari's 7-day rule — and why a local database must be rebuildable.

    • storage
    • OPFS
    • offline
  3. 7 min read

    Dexie alternative: how to check the drop-in claim is true

    Dexie's API is the right shape; the open question is what runs underneath it. How to verify a drop-in replacement claim instead of taking it on trust.

    • comparison
    • testing
    • IndexedDB
  4. 6 min read

    IndexedDB vs SQLite WASM: which browser database should you use in 2026?

    A side-by-side of IndexedDB and SQLite compiled to WebAssembly — query power, bundle cost, multi-tab safety and browser support — plus the four questions that decide it for a real application.

    • IndexedDB
    • SQLite
    • comparison
  5. 7 min read

    The localStorage size limit, and what to use instead

    localStorage is capped near 5 MB, stores only strings, and blocks the main thread on every read. When that is fine, when it is not, and what to move to.

    • storage
    • performance
  6. 7 min read

    Offline-first vs local-first: which one do you actually need?

    Cache-first, offline-first and local-first are three different amounts of work. Which one your app needs, and why the local copy owning the truth costs most.

    • offline
    • storage
    • comparison
  7. 6 min read

    SQLite WASM bundle size: what it costs and when it pays back

    SQLite compiled to WebAssembly costs several hundred kilobytes. What actually downloads, why loading it synchronously makes your first page slower, and the fix.

    • SQLite
    • performance
  8. 8 min read

    Structured clone vs JSON.stringify: what survives storage

    JSON.stringify silently loses Date, NaN, undefined, typed arrays, Map, Set and RegExp. Structured clone keeps them all. Here is a table of what each preserves.

    • storage
    • IndexedDB
    • comparison
  9. 7 min read

    Electing one writer across browser tabs with the Web Locks API

    How the Web Locks API elects a single writer across browser tabs with no heartbeat and no timeout to tune — and the one failure mode you still have to handle.

    • concurrency
    • OPFS
    • storage
  10. 8 min read

    What is OPFS? The origin private file system, explained

    OPFS is a private, origin-scoped area the browser manages — not the user's disk. What sync access handles are, why SQLite needs them, and where OPFS is missing.

    • OPFS
    • storage
    • SQLite