Lurker News

Comments (189) 38 threads

Show all comments

Showing thread 2 of 38

arianon2 replies#
Shocked to find out that this is very much a static website, it's "merely" downloading a small portion of the 43GB SQLite file in question with HTTP Range requests, and then it uses a WASM-compiled copy of SQLite to query the requested data. Very impressive.
JoeyBananas4 replies#
wouldn't this be vulnerable to DOS attacks? I can make the database run arbitrarily long and complicated queries
CodesInChaos#
The database runs on the client. It can't do anything you couldn't do through any other http client.
simonw2 replies#
Since the work all happens in your browser, the only victim of a long complicated query would be you own browse and the S3 bandwidth bill of the person hosting the database (since you'd end up sucking down a lot of data).

But if you want to jack up someone's S3 bandwidth bill there are already easier ways to do it!

floatingatoll1 reply#
It's a static file, CDN it.
simlevesque7 replies#
Many CDNs cannot cache 43GB files.

Cloudflare's limit is 10GB, 20GB for Cloudfront, 150GB for Akamai and Azure.

Continue this thread — 7 replies

jlg231 reply#
If I get the essence of what you are saying... "the only victims would be both ends of the communication"? ;)

Continue this thread — 1 reply

chrisseaton#
> I can make the database run arbitrarily long and complicated queries

Do you understand that the database runs on your computer? You can only DOS yourself.

lillecarl1 reply#
In a smart webserver this could mean not a whole lot more than a memcpy, and between you and the CDN it probably won't be too high latency.

One would have to version the SQLite DB by version to avoid corruption by cache invalidation.

Continue this thread — 1 reply

scrame#
Wow! The end where they use sql to manipulate the DOM I think just blew a fuse in my brain. "Brilliant" feels like an understatement.
MuffinFlavored#
On insert from Netlify:

> [error: RuntimeError: abort(Error: server uses gzip or doesn't have length). Build with -s ASSERTIONS=1 for more info.]
On insert from Github Pages:
> [error: Error: SQLite: ReferenceError: SharedArrayBuffer is not defined] Your browser might either be too old to support SharedArrayBuffer, or too new and have some Spectre protections enabled that don't work on GitHub Pages since they don't allow setting the necessary isolation headers. Try going to the Netlify mirror of this blog for the DOM demos.

k__1 reply#
Didn't know you could pump 43GB of data into a browser.
wmf#
The trick is that the browser is not downloading all 43 GB, just the parts it needs.