Using SQLite server-side
It’s been a few years since SQLite became my go-to choice for small websites. I’ve never had a chance to use it at a larger scale but when I see how little CPU it is using at the moment, I’m really confident in its potential.
You know, I worked for years in companies where main databases were hosted on remote machines managed by third parties, perhaps in another data center. In this situation even the most simple queries can have a latency of 10 milliseconds or more. It may not seem like much but it adds up quickly in complex applications if you are building some sort of subsystem used everywhere. And at the end of the day people wonder why it takes two or three seconds to perform a simple action on the app 🙃
I think embedded databases like SQLite are a great choice for websites of small local businesses that can’t spend hundreds of dollars a month on web hosting. Businesses that have 90% of their users located in the same region, you know. If the website is hosted in that region, most users will have a virtually latency-free experience, for little money. It’s absurd that a blog engine like WordPress does not support SQLite officially. And from a developer’s perspective I think SQLite is generally easier to work with; you can actually use many small queries instead of writing complex joins, and the JSON support is quite good and often helpful.
This website is powered by SQLite. It is currently hosted on one server in Europe, so it probably feels slower elsewhere, but where I live most API requests complete in less than 15 milliseconds. Under the hood, most database queries take tens of microseconds. At the moment it does not really need to be that fast, but if there are more users in the future (I hope so!) I think this is basically a nice side-effect of designing the system to handle a large number of users on a cheap VPS. Even if I would not describe myself as a strong environmental advocate, I prefer not wasting too many resources.