Live data from Hacker News

How we sped up Notion in the browser with WASM SQLite

notion.so

11–20 of 107 posts

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

#12

Earlier quoted context omitted.

They already did that. It was called WebSQL. It was removed I think in favor of IndexedDB.

[..] Web SQL Database was a prior API developed by Apple.[12] But Firefox refused to add support for it and argued against it becoming a standard because it would codify the quirks of SQLite.[13][14] It was thus deprecated in favor of IndexedDB.[..] Mozilla again.. The real joke is, Firefox is now the only(?) browser using sqlite out-of-the-box for internal databases.

nope, chromium too. look in your cookies file

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

#13

Overall I think using SQLite locally to offload database work is incredibly powerful. Given most laptops have an SSD now a days, you can scan an entire 30-100MiB SQLite db in miliseconds. Meanwhile in AWS you would pay $27k a month to have the same IOPS as a Lenovo Thinkpad X1. I just got done with a side project using WASM SQLite as well, it's incredibly powerful, even supports full text search. My project "cluttr"…

If you think those read speeds are great, try DuckDB (which has many SIMD improvements) if you want to blow your socks off.

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

#14

Overall I think using SQLite locally to offload database work is incredibly powerful. Given most laptops have an SSD now a days, you can scan an entire 30-100MiB SQLite db in miliseconds. Meanwhile in AWS you would pay $27k a month to have the same IOPS as a Lenovo Thinkpad X1. I just got done with a side project using WASM SQLite as well, it's incredibly powerful, even supports full text search. My project "cluttr"…

> Meanwhile in AWS you would pay $27k a month to have the same IOPS as a Lenovo Thinkpad X1.

Curious about how this number was arrived at and what products were involved

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

#16
Honestly, we should just have native SQLite supported by the browser.

SQLite has become the defacto local single file database standard.

It has a very permissive license.

It has support contracts out to the 2050s (service lifetime of Airbus A350 airframe).

SQLite will probably have a longer lifetime than whatever browser standard we have now.

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

#17
Will the tables in the Notion mobile app still be so painfully slow? Every time I scroll few rows down (in a table with few than 100 rows with dozen columns), the app hangs for several seconds while trying to fetch/render (who knows what it's actually doing) few additional rows. When I edit a row and return back to the table view, scroll position is lost and I have to suffer through the fetching once again.

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

#18

Overall I think using SQLite locally to offload database work is incredibly powerful. Given most laptops have an SSD now a days, you can scan an entire 30-100MiB SQLite db in miliseconds. Meanwhile in AWS you would pay $27k a month to have the same IOPS as a Lenovo Thinkpad X1. I just got done with a side project using WASM SQLite as well, it's incredibly powerful, even supports full text search. My project "cluttr"…

If you think those read speeds are great, try DuckDB (which has many SIMD improvements) if you want to blow your socks off.

Do these SIMD improvements still apply if you’re compiling DuckDB to WASM and run it in a browser?

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

#19
post #12

Earlier quoted context omitted.

[..] Web SQL Database was a prior API developed by Apple.[12] But Firefox refused to add support for it and argued against it becoming a standard because it would codify the quirks of SQLite.[13][14] It was thus deprecated in favor of IndexedDB.[..] Mozilla again.. The real joke is, Firefox is now the only(?) browser using sqlite out-of-the-box for internal databases.

nope, chromium too. look in your cookies file

I did, but seems I missed the actual subfolder where the databases are saved. But this makes it even worse. They all have sqlite installed, but offer not API for making use of it. Really missed chance.

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

#20
Seeing things like that excite me a lot, I can't wait for a future where all the code is written in whatever language you like and runs through WASM in the browser. The HTML and JS can go back doing that thing they are built for: Displaying the UI and handling the interactions.
Post reply on HN