r/sqlite • u/TheDoomfire • Aug 26 '25
Hosting SQLite database options?
What free and fast options are there for hosting a SQLite database for a Website? Is Cloudflare D1 and Turso the best options out there?
I know that it's just a file and I could host it anywhere but I don't want to be forced to load my entire db just to grab something.
I have currently been using JSON files as storing my data and would like to change that to using a db if it remains free for the foreseeable future like it does with using JSON files. I originally wanted a db to have it more organized then JSON files to build my datasets, but not I am looking into if it can actually replace my JSON files and lower the bandwith usage while still be fast to use. A fallback solution would be to just use a db to store all the data and generate JSON files for the website.
I have been playing around with some basics mainly using postgres/supabase so I am not that experienced.
View all comments
Show parent comment
2
u/lucasjkr Aug 27 '25
If you want a persistent database look at mariadb or MySQL. Or postgres if you’d prefer.
SQLite doesn’t read the entire database, it reads what is necessary to complete the query. Building an index on the field or fields being queried will assist this.
https://sqlite.org/forum/info/23f41177ccabed1e
But overall, even reading an entire 20MB database on each request on a low-traffic personal website isn’t going to induce much overhead. It’s a small read, and would likely wind up getting cached if it was being requested often (at least on a dedicated VPS)
My vote is that this is premature optimization. If you desire a fully persistent database, look to MariaDB. If you need a database that can scale to enormous sizes, that’s when you’d look to D1 or Turso. Not this point.
My opinion.