←back to thread

275 points whatisabcdefgh | 7 comments | | HN request time: 0.409s | source | bottom
1. supportengineer ◴[] No.45133233[source]
What if instead of API's for data sets, we simply placed a sqlite file onto a web server as a static asset, so you could just periodically do a GET and have a local copy.
replies(4): >>45133260 #>>45133305 #>>45133319 #>>45133437 #
2. yupyupyups ◴[] No.45133260[source]
This works as long as the data is "small" and you have no ACL for it. Assuming you mean automatic downloads.

Devdocs does something similar, but there you request to download the payload manually, and the data is still browsable online without you having to download all of it. The data is also split in a convenient manner (by programming language/library). In other words, you can download individual parts. The UI also remains available offline, which is pretty cool.

https://devdocs.io/

3. abtinf ◴[] No.45133305[source]
With an S3 object lambda, I suppose you could generate the sqlite file on the fly.
4. abtinf ◴[] No.45133319[source]
A few years ago someone posted a site that showed how to query portions of a SQLite file without having to pull the whole thing down.
replies(1): >>45133464 #
5. anon291 ◴[] No.45133437[source]
You can do this today by using the WASM-compiled SQLite module with a custom Javascript VFS that implements the SQLite VFS api appropriately for your backend. I've used it extensively in the past to serve static data sets direct from S3 for low cost.

More industrious people have apparently wrapped this up on NPM: https://www.npmjs.com/package/sqlite-wasm-http

6. dbarlett ◴[] No.45133464[source]
https://news.ycombinator.com/item?id=27016630
replies(1): >>45133629 #
7. supportengineer ◴[] No.45133629{3}[source]
>> I implemented a virtual file system that fetches chunks of the database with HTTP Range requests

That's wild!