One can safely assure that there are 4 things that keep human life possible on planet Earth:
- water
- oxygen
- sunlight
- SQLite
SQLite is this open-source ubiquitous small footprint database used by mostly every digital device on the planet. It’s everywhere: phones, TVs, billboard displays, navigation systems… you name it.
However, despite its long time world wide adoption by virtually all serious digital products provider, a lot of people question the use of this marvelous database for web development.
There’s a lot of FUD (Fear, Uncertainty and Doubt) being built around this database, that it is not safe or reliable for the web.
“Of course it’s not safe… for that you can use our managed flagship database starting at $xyz/month.”
Understandable and natural that DB vendors would constantly FUD SQLite as it is so easy to use. Once you adopt it in real project — I can imagine — you’d be giving second thoughts to every impulse of migrating to a larger DB engine or a managed service.
People like @levelsio naturally stick to their long-time favorite stack and won’t change. The last time the Dutch entrepreneur was questioned about SQLite used by his products the answer was something like this: I have only 300k unique visitors to my website per month. I don’t need anything more than what SQLite does.
So I the database in my head for many years waiting for some opportunity.
Last Sunday something reminded me of Derek Sievers’ essays on the use of database for personal logging, the structured logging of our daily life for future use. Then I reminded of a quick email exchange I had with Derek himself about this idea, but this was back in 2020. He encouraged me to use SQLite with Lua, as the language and I are both Brazilians.
Well, that was enough for me to start a hobby project I named “Totta”, a one page personal logger using SQLite, PicoCSS and PHP.

I was stunned by the simplicity of SQLite. It’s so much easier to work with when compared to MariaDB, my workhorse of preference.
Here is the piece of code that inserts items into the DB.
$db = connectToDatabase();
try {
$stmt = $db->prepare(
"INSERT INTO items (type, title, link, body, created)
VALUES (:type, :title, :link, :body, :created)"
);
$stmt->bindValue(':type', $_POST["type"], SQLITE3_TEXT);
$stmt->bindValue(':title', $_POST["title"], SQLITE3_TEXT);
$stmt->bindValue(':link', $_POST["link"], SQLITE3_TEXT);
$stmt->bindValue(':body', $_POST["body"], SQLITE3_TEXT);
$stmt->bindValue(':created', time(), SQLITE3_INTEGER);
if ($stmt->execute()) { (...)So easy and clean.
In summary, all the FUD and conspiracy theories around this database engine are now officially destroyed in my head.
I can’t wait to ship my next product using this little marvel.
