Other

Why I'm running this blog on a single SQLite file

No CMS, no markdown files in the repo, no Postgres. One file on disk, a couple of routes, and the whole admin panel in a browser.

sqliteself-hostinginfra

I've been running side projects on a VPS for years, and I keep reaching for the same boring stack: Next.js behind Nginx, managed by systemd. This blog is no different.

The premise

  • No external CMS. The admin panel lives in the app itself, under /admin.
  • No markdown files in the repo. Posts are rows in a SQLite database, edited in the browser.
  • One dependency for storage. better-sqlite3 opens a single file in data/blog.db.

Why not Postgres?

Honestly, a personal blog is a handful of rows. Postgres is lovely, but it's a whole service to back up, upgrade, and keep alive. SQLite gives me:

const db = new Database("data/blog.db");
db.exec("CREATE TABLE IF NOT EXISTS posts (...);");

That's the entire database. It's a file I can scp, tar, and rsync around without draining a socket.

The trade-offs

SQLite isn't for every workload — concurrent writes across many processes will contend. But for reading blogs and writing the occasional post, it's the right amount of database.

Why I'm running this blog on a single SQLite file · maulome