Standalone process that streams SQLite write-ahead log changes to local paths or remote storage for incremental disaster recovery. Integrates without modifying application code.
Overview
Litestream is a disaster recovery companion for SQLite databases. It runs alongside your application as a separate process, watches the database write-ahead log, and replicates changes incrementally to a configured replica destination.
Replicas can target local filesystem paths or supported remote object storage backends, so you can keep off-site copies without running a separate database cluster. The tool is aimed at single-node SQLite deployments that still need continuous backup and a path to restore after server failure.
Because it operates outside the app, existing SQLite programs can adopt it without code changes. Replication introduces a small internal lock table in the source database to coordinate WAL checkpoints; that schema change is expected while Litestream is active. Graceful shutdown attempts to finish syncing on SIGINT or SIGTERM within configurable timeouts.
File replica URLs follow URL path escaping rules, including Unicode paths and percent encoding. The project also offers a Go library interface for embedding replication in other programs, though process-level shutdown behavior differs for library callers.
Key features
- Incremental SQLite WAL streaming
- Local file and cloud storage replicas
- Runs as separate background process
- No application code changes required
- Configurable graceful shutdown timeouts
- Go library for embedded replication
- URL-escaped file replica paths
- Restore from latest replicated state
Use cases
- Continuous backup of production SQLite
- Cheap object-storage database replicas
- Single-server apps needing DR copies
- Recovering after host or disk failure
- Off-site replication without extra DB servers