Get real, active and permanent YouTube subscribers
Get Free YouTube Subscribers, Views and Likes

Host your Database for Free on Github Pages

Follow
Bufferhead

Databases are an essential part of many modern web applications but running them can be really expensive. That’s why in this video I’ll show you how you can run an SQLite Database completely for free, on top of Girhub Pages. GitHub Pages allows you to host files and websites. But using the JavaScript library SQL.jsHTTPVFS it is possible to use an SQLite dataset completely hosted as static files.



===


Check out my project „solidtime The modern OpenSource Time Tracker„ on https://www.solidtime.io


===


The final result of the „On this day“ can be found here: https://onthisday.bufferhead.com/


The GitHub repository with all the source code: https://github.com/bufferheadcode/on...


===


Check out SQL.jsHTTPVFS at:
https://github.com/phiresky/sql.jsht...


If you want to find out more about it, the author explained the initial implementation here:
https://phiresky.github.io/blog/2021/...


You can find the dataset used for the „On this day“ website here:
https://www.kaggle.com/datasets/guill...


===


Regular databases like MySQL, Postgres or Redis/Valkey run as a service and need server side computing power work. But SQLite is quite a bit different. The Database runs as a single file database and is really useful for various applications that need a performant but simple database. You can use SQL to query the database just like with any other database. The main difference is that we can use the fact that SQLite only needs a filesystem to run to distribute it with static page hosting services like Guthub Pages. It is also possible to use CDNs like Cloudflare or BunnyCDN to distribute the database very cheap. We use the HTTP Protocol to our advantage and set an HTTP range header to request only the parts of the SQLite database we actually need in our application.

posted by gerifalteez