Tacet

Field notes on software that stays out of the way.

SQLite is a fine default

For a new service, the first database question is usually “which server?” It is worth asking whether you need a server at all.

What you get

SQLite is a library that reads and writes a single file. There is no daemon to run, no connection pool to tune, no network hop on every query. Backups are a file copy, or VACUUM INTO while it is running. Tests get a real database in memory.

Settings that matter

PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA busy_timeout = 5000;
PRAGMA foreign_keys = ON;

WAL mode lets readers run alongside a writer. With it, a single machine handles thousands of writes per second and far more reads — plenty for most internal tools and many products.

When to move on

  • Several machines need to write at once.
  • Write volume outgrows a single disk or a single writer.
  • You need features it does not have, such as fine-grained access control.

Until then, the simplest database is the one you never have to page someone about.

← All writing