Earlier quoted context omitted.
Microsoft Access Cloud Edition, basically?
Sort of. Access had a "Forms" feature that let you create basic GUIs on top of your database. Also, the OP's project is (currently) only providing a read-only view of the SQLite database. Adding write support is possible but will be far less impressive to the HN crowd because SQLITE_BUSY will rear its ugly head ;-)
Hosting SQLite databases on GitHub Pages or any static file hoster
221–230 of 252 posts
Re: Hosting SQLite databases on GitHub Pages or any static file hoster
#222This is amazing! I'm also surprised that Github Pages lets you present arbitrary JS to the point where you can upload SQLite as WebAssembly. Isn't this dangerous?
Re: Hosting SQLite databases on GitHub Pages or any static file hoster
#223Re: Hosting SQLite databases on GitHub Pages or any static file hoster
#224Earlier quoted context omitted.
Would also be great to add (efficient) search to a static blog.
Definitely. Just need to add a layer to the static site generator for it to populate the SQLite DB, right?
Re: Hosting SQLite databases on GitHub Pages or any static file hoster
#225Very clever. I wonder if there are databases optimised for this use case. I can imagine something that always requires indexes to do the queries and stores data in disk in ways to make it easy to fetch only the bits you need.
That would be equivalent to always putting your data in b-trees or other structures, according to the request patterns, without keeping the tables themselves. Sort of how you need to do that in Redis for any kind of sane request strategy other than key-value lookups.
But my question revolves around databases assuming that the disk they access is local or at least a fast network storage. I wonder if there are any databases optimized to access slow storage over low bandwidth, where you're really trying to optimize the amount of data read more than anything else.
Re: Hosting SQLite databases on GitHub Pages or any static file hoster
#226Earlier quoted context omitted.
I think that's what the "optimize for Web" checkbox does
Wow so it actually does something! I wish programs would use such vague descriptions. (Or more of them had helpful instant tooltips.)
Re: Hosting SQLite databases on GitHub Pages or any static file hoster
#227Earlier quoted context omitted.
That would be equivalent to always putting your data in b-trees or other structures, according to the request patterns, without keeping the tables themselves. Sort of how you need to do that in Redis for any kind of sane request strategy other than key-value lookups.
Hm, yeah, I think a key-value store would be easier to implement. I haven't looked at redis for some time now, but last time I did, persistence was done through snapshotting and everything would really be loaded into memory at start time. So that wouldn't work for this use case, where all you can do is serve a static file. But my question revolves around databases assuming that the disk they access is local or at lea…
Actually, this sort of partial access (i.e. partitioning) is rather easy to implement by addressing separate data files by name, instead of using numeric ranges into a database. Basically just put the data into files named by the years (in my example); or bucket the data into chunks of arbitrary size and use the chunks as files. Elementary to extend this to multiple fields in the index. In short, partitioning based on actual field values can be much easier in the static-http approach than using opaque ranges. Probably also more effective if something like http2 allows requesting several files in one request—since you can avoid requesting too little or too much.
Re: Hosting SQLite databases on GitHub Pages or any static file hoster
#228Re: Hosting SQLite databases on GitHub Pages or any static file hoster
#229Earlier quoted context omitted.
TL;DR http, properly implemented, supports a ton more stuff than even many “web developers” are aware of, like… range requests, which are exactly what you’d think they’d be.
the most recent update to the W3C's own research webserver, written in Java, called Jigsaw, seems to be dated in 2007. I used it for a lot of purposes until 2002 but I don't know why I stopped working with Jigsaw only that by the time F# emerged in 2004 I was absorbed into a new direction : https://jigsaw.w3.org/ iirc Jigsaw was used to develop and validate the WebDAV protocols and XQUERY which at the time I remember…
Re: Hosting SQLite databases on GitHub Pages or any static file hoster
#230I didn't fiddle with the window sizes like the submitted article (the chunk is fixed to 8KiB), but I did optimize it so that reading chunk N+1 of the file reused the response reader of chunk N rather than make a new request. Furthermore I keep an LRU cache of only the last three chunks in memory, because the ZIP files are each only read once.
[1]: https://github.com/Arnavion/fac-rs/blob/2d2622a1c9934719ce65...
[2]: https://github.com/Arnavion/fac-rs/blob/2d2622a1c9934719ce65...