5 ms·
Might be a little bit off topic. I created a web page, with data. I didn't want to host VPS, be charged for traffic. I do not want also to play with cloudflare
by renegat0x0 2y ago
Might be a little bit off topic. I created a web page, with data. I didn't want to host VPS, be charged for traffic. I do not want also to play with cloudflare and self-hosting.
My solution? The app is a webpage, which reads SQLite. If user wants to use app, the database is downloaded, unpacked, and used on users device.
Links:
- https://github.com/rumca-js/Internet-Places-Database https://github.com/rumca-js/Internet-Places-Database - search.html provides a preview for my database file (but code supports also reading zip file).
- https://rumca-js.github.io/search?file=top&page=1&search=neocities.org https://rumca-js.github.io/search?file=top&page=1&search=neo... - uses JSON files stored in a zip file. Will be replaced soon with zip + sqlite file
- https://rumca-js.github.io/search?file=music&view_display_type=gallery&view_show_icons=true https://rumca-js.github.io/search?file=music&view_display_ty... - example showing my fav music. As above uses JSON files, in a zip file
- IshKebab 2y agoI mean if you only have a few thousand records you barely need a database at all.
- x-complexity 2y ago> I mean if you only have a few thousand records you barely need a database at all. Keyword being "barely". There are organization benefits if you can structure your data into a DB, instead of having each page redundantly hold the same header & metadata info.
- renegat0x0 2y agoPreviously I have been using JSON. However there are multiple structures with relations between them so... this seems to be a database. Extracting data from it also becomes really really easy with selects. Otherwise I would have to implement, or reuse some algorithms to filter JSON data, etc.
- billywhizz 2y agothis is nice. i like the idea which has been tried in a few places of running sqlite in the browser directly/locally. the only thing that is really missing to make this work at a bigger scale for read-heavy databases is a very cheap or free static hosting service which does range requests, allows you control of CORS and doesn't have the file size limitations of gist or github pages. maybe this exists already? S3 would do i guess? you can do kinda magic things like this and build websites that connect to multiple different databases around the web and... well, i'll leave the rest up to your imagination. go here: https://just.billywhizz.io/sqlite/squeel/ https://just.billywhizz.io/sqlite/squeel/ hit CTRL/CMD + Q on your keyboard. paste in this sql ``` attach database 'https://raw.githubusercontent.com/just-js/just.billywhizz.io/73c93bbaf6599cdf425f288d00dc4ab7f0f89800/sqlite/demo/db/chinook.db https://raw.githubusercontent.com/just-js/just.billywhizz.io...' as chinook ; select * from albums ; ``` and hit CTRL/CMD + g to run the queries.