Hacker News new | ask | show | jobs
by choilive 472 days ago
> Ultimately I’d prefer to serve every read from your device’s local storage, which is my current project.

Is that for native desktop/mobile clients only or web as well?

1 comments

All platforms; we already cache and serve locally using SQLite (see https://www.notion.com/blog/how-we-sped-up-notion-in-the-bro...) but the cache is built as an optimization -- loads look like `isFastDevice ? (await loadLocal(request) ?? await loadRemote(request)) : (race(loadLocal(request), loadRemote(request))`

We're working on redesigning the data architecture to be more truly "local first" where every read should come from local, and falling back to the server is a rare exception. We want this to look like `await loadLocal(request) ?? await sync({ priority: request }).then(() => loadLocal(request))`

(Note: for features like content that make sense offline. Some features, like user invitation and management, only make sense online)

Oh nice. I had dismissed offline/local web apps for anything decently complex for a long time because of the file system limitations. But it looks like this will finally make that practical with OPFS & WASM SQlite. Thanks for sharing.