Litestream v0.5.0 is Here Author: Ben Johnson (@benbjohnson) Reading time: 8 min Published: Oct 2, 2025 --- Overview Litestream is an open-source tool developed by Fly.io that provides resilience for SQLite-backed applications by streaming writes to object storage, enabling quick restoration after server failures. It runs alongside unmodified SQLite apps, intercepting changes efficiently and invisibly. The latest major update, version 0.5.0, introduces several significant improvements, including faster performance and efficient point-in-time recovery (PITR). --- Background and Evolution Litestream was created to fill the gap of backup/restore systems for SQLite. Alongside Litestream, the team developed LiteFS, a FUSE-based filesystem to enable live replication for SQLite apps. LiteFS enables multiregion primary/read-replica deployments but is more complex. The user community prefers Litestream for its simplicity and ease of use. Recent updates aim to incorporate lessons learned from LiteFS back into Litestream. --- Key Feature: The LTX File Format SQLite internally organizes data in disk-aligned pages within B-trees. Litestream originally operated at the page level, causing inefficient restoration since every modified page needed replaying, often a slow process. LTX is a new file format designed to represent transactions as ordered ranges of pages, supporting compaction. LTX files allow combining multiple changes compactly, removing duplicates and enabling quicker restoration. The hierarchy of compactions enables: Level 1: Compacting changes every 30 seconds Level 2: Compacting Level 1 files every 5 minutes Level 3: Compacting Level 2 files hourly Result: Restoration requires only about a dozen files on average. Litestream handles compaction independent of SQLite, limiting process bottlenecks to I/O throughput. --- Removal of Generations Concept Previous Litestream versions manage multiple backup "generations" to handle resynchronization after crashes. The new LTX-based system removes generations completely. Database state can now be retrieved via monotonically increasing transaction IDs. This simplifies lookup and avoids complexity related to multiple backup "dimensions." --- Upgrading to v0.5.0 v0.5.0 cannot restore old v0.3.x WAL segment files directly. Upgrade steps: Begin using v0.5.0; old WAL files remain intact for fallback. New LTX files are stored in an ltx directory on replicas. Configuration remains fully backward compatible. New constraint: one replica destination per database is enforced. Previous WAL segment references have been replaced with transaction IDs (TXID). Command change: litestream wal is now litestream ltx. --- Additional Improvements in v0.5.0 Enhanced LTX library: Compression now per-page with indexes for quick individual page access. Enables potential advanced features such as querying database state without downloading the entire database. Removal of CGO dependency. Adopted modernc.org/sqlite as SQLite driver instead of mattn/go-sqlite3, facilitating cross-compilation. Added support for NATS JetStream replica type for users with existing JetStream setup—removing dependency on external object storage. Upgraded S3, Google Storage, and Azure Blob Storage clients for compatibility with latest APIs. --- Future Plans Developing Litestream VFS for read replicas: Instantly spin up a copy of the database. Read pages directly from S3 while database is hydrating in the background. Proof of concept exists; full feature to be announced soon. --- Summary Litestream v0.5.0 introduces: A transformative LTX file format enabling efficient, transaction-aware backups and point-in-time recovery. Simplified backup coordination by removing multi-generation backups. Improved performance and reliability.