Litestream: streaming backups for SQLite databases
One open-source tool a week. What it does, what it replaces, and something you can build with it — in under three minutes.
What it is
Litestream is a standalone background process that continuously streams every change made to a SQLite database file into object storage — S3, MinIO, Backblaze B2, Azure Blob, Google Cloud Storage, and more — so you always have an off-box, near-real-time copy to restore from.
What it replaces
It replaces the pile of things people build by hand to make SQLite feel production-safe: a cron job that sqlite3 .backups the file every few minutes and pushes it to S3, a hand-rolled WAL-shipping script, or — more often — the decision to “just use Postgres” purely for the managed backups, when a single-server app didn’t need a database server at all. Litestream talks to SQLite only through its normal API, so it can’t corrupt the database, and it runs as a separate process: no code changes to your app.
What you can build
A single-server app (say, a small SaaS or internal tool) with automatic, restorable backups running every few seconds, for pennies a month in object storage. A minimal config, /etc/litestream.yml:
dbs:
- path: /data/myapp.db
replicas:
- url: s3://my-bucket/myapp.db
Then run it as a background service:
litestream replicate
If the server dies, restoring is one command — it refuses to overwrite an existing file, so you can’t accidentally clobber a live database:
litestream restore -o /data/myapp.db s3://my-bucket/myapp.db
It also supports point-in-time restores to a specific transaction ID, and a “follow mode” (-f) that keeps a read-only replica continuously up to date — useful for a warm standby without running a second database server.
Where to get it
Repo: github.com/benbjohnson/litestream — 14.3k GitHub stars at time of writing (from the repo page directly, not a marketing claim). Docs: litestream.io, including a 10-minute getting-started tutorial against a local MinIO instance and reference guides for every supported storage backend. Licence: Apache 2.0 — verified against the LICENSE file at the repo root, genuinely open source, no source-available caveats. It’s actively maintained (currently on the v0.5.x line) and used in production, including by Fly.io, but it is squarely a single-server tool — it doesn’t turn SQLite into a multi-writer cluster, so know that boundary before you reach for it.
One thing I could not verify independently: Litestream’s own claim of “pennies per day” cost depends entirely on your write volume and chosen storage class — treat it as directionally true, not a number to budget against.
Get next week’s tool by email. One tool, every week. Three minutes. No news roundups, no digest. — sign-up coming shortly