Live data from Hacker News

How we sped up Notion in the browser with WASM SQLite

notion.so

101–107 of 107 posts

Re: How we sped up Notion in the browser with WASM SQLite

#101
post #87

Earlier quoted context omitted.

SQLite is not SQL standards compliant. It doesn't even support data types from core SQL-92. One needs more than INTEGER, REAL, TEXT, BLOB for applications. Adopting it as WebSQL would have been a terrible mistake.

Is IndexedDB SQL standards compliant? Inventing IndexedDB is a terrible mistake.

Fully agreed. Lets not compound a mistake with another mistake.

Re: How we sped up Notion in the browser with WASM SQLite

#102

Earlier quoted context omitted.

Is IndexedDB SQL standards compliant? Inventing IndexedDB is a terrible mistake.

Fully agreed. Lets not compound a mistake with another mistake.

Fair enough. But if I could pick just one mistake, I'd pick SQLite.

Re: How we sped up Notion in the browser with WASM SQLite

#103

Earlier quoted context omitted.

For anything database-lite, https://coda.io is a lot better than notion.

I tried Coda a few months ago. The feature set was very appealing. Coda turned out to be slower and more buggy than Notion, especially when routinely working with databases. The typography and graphic design were also less polished. I kept using Coda until I could no longer tolerate its issues and then have moved everything to Notion.

I work at Coda and would love to hear more about your experience. We are focused on our tables and formulas and I am surprised to hear that you had such a bad time with them. Feel free to reach out at gleb at coda dot io.

Re: How we sped up Notion in the browser with WASM SQLite

#104
post #53

Earlier quoted context omitted.

It sucks that even the newest make-wadm-sqlite-fast FileAccessHandles are still an intermediated virtual file system hosted by the browser. I don't get why we have three different file system APIs on the web and none that just use files. Meanwhile WASI has their own server-side file system APIs but neither WASI nor the browser side seem to have any effort to get on the same page. It'll be 2035 before component-model…

The profusion of underpowered interfaces is frustrating but I don't see how browsers could "just use files" What does this mean? Providing the POSIX filesystem C language APIs with file descriptor numbers, etc? I guess the browser makers could go Cosmopolitan-C style and emulate the Linux filesystem interface on all platforms, but I think you'd find there's still a weird intermediary layer in between your code and th…

Mingw has been paving over the differences for years. Node.js paves over them, makes windows look very posix'y.

I'm tired of Windows being an excuse, a forever dragging boat anchor, a lower than low denominator that justifies doing shitty jobs. Keep the current virtualized file system for Windows that's fine, but man, we should stop designing specs, setting the future to keep targeting the dirty distant sad past. And we have decades of experiences (mingw) showing that we can polyfill a good platform atop the big bad no good windows Boogeyman.

It just feels like the make excuse for bad camp has been in charge of our spiritual direction for 25 years here & it's never gotten us anywhere. It's always pretty shitty. I struggle to believe these protestations against doing the natural good thing help. We should 100% just triple down on trying, on bringing WASI forward.

Re: How we sped up Notion in the browser with WASM SQLite

#105

Earlier quoted context omitted.

Curious where you're moving? About to begin finding a tool similar to Notion (but not Notion).

I’d love advice too - I’ve become heavily reliant on Notion’s database-lite features, which is what a lot of the markdown-based apps don’t invest in by default. I’m beginning to get frustrated with loading speeds that feel like spinning disks.

We’re rolling out a new databases backend right now, if you email jake@makenotion.com I’d like to make sure we’re optimized for your database views

Re: How we sped up Notion in the browser with WASM SQLite

#106

OPFS is only available in Web Workers. I don't think this is correct: https://developer.mozilla.org/en-US/docs/Web/API/File_System...

Great catch. It's specifically SQLite-via-OPFS that needs to be within a Web Worker. we fixed this in the post!

Re: How we sped up Notion in the browser with WASM SQLite

#107

We've been using wasm sqlite with kotlin-js and the kotlin sqldelight framework. This is admittedly a bit of an exotic stack to be running in a browser. But it actually works surprisingly well. Unfortunately the failure modes with opfs are kind of ugly and need some attention. A key issue is controlling what happens when you have multiple tabs open interacting with the same DB. One interesting thing is that opfs maxi…

Have you experienced the corruption issues mentioned in the original article?
Post reply on HN