Northbound Systems

Engineering notes on backend systems, databases, and small infrastructure.

SQLite in Production, Carefully

July 22, 2026 · Databases

SQLite carries an enormous amount of production workload relative to the respect it gets. The failures we have seen — our own and other people's — almost never come from the engine. They come from three defaults that are calibrated for embedded use in 2004, not for a web service in 2026.

WAL mode is not optional

The default rollback journal allows exactly one writer and blocks readers while it works. Write-ahead logging lets readers and the writer proceed concurrently, which is the difference between "fine" and "database is locked" errors under any real write load:

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

busy_timeout deserves emphasis: without it, a contended write fails immediately instead of waiting a few milliseconds for the lock to clear. Half the "SQLite can't handle concurrency" stories are this one pragma, unset.

One writer is a design constraint, not a flaw

SQLite serializes writes. Architectures that respect this — batch writes, keep transactions short, let a single process own the write path where practical — run happily at volumes that surprise people. Architectures that fight it, with a dozen services hammering the file over a network filesystem, fail and then blame the database. The network filesystem point is absolute: WAL requires shared-memory coordination that network filesystems do not provide. Local disk or it does not count.

Backups are a solved problem, if you use the API

Copying the file of a live database is how you get a corrupt backup with extra steps. The online backup API (or VACUUM INTO) produces a consistent copy while the database serves traffic. We schedule it nightly and — per our standing rule — restore-test it quarterly.

Used within its shape, SQLite is the most operationally boring database we run. Boring is the highest praise infrastructure gets.

← All articles