litestream README

The project's README from github.com/benbjohnson/litestream. As one markdown file: README.md.

Litestream GitHub release (latest by date) Status GitHub Docker Pulls

Litestream is a standalone disaster recovery tool for SQLite. It runs as a background process and safely replicates changes incrementally to another file or S3. Litestream only communicates with SQLite through the SQLite API so it will not corrupt your database.

If you need support or have ideas for improving Litestream, please visit GitHub Issues. Please visit the Litestream web site for installation instructions and documentation.

If you find this project interesting, please consider starring the project on GitHub.

Source database changes

When Litestream begins replicating a database, it creates an internal _litestream_lock table in the source SQLite database. This is expected and safe to leave in place. Litestream uses the table to acquire SQLite's write lock while coordinating synchronization around WAL checkpoints. The writes occur in transactions that are rolled back, so Litestream does not leave rows in the table.

The table is part of the source database, not a separate table in the replica destination. Because the source schema is backed up, restored databases also contain it. Its creation changes the source database schema and can change its page count or bytes, so a database under Litestream should not be expected to remain byte-identical to its pre-Litestream state.

Do not drop _litestream_lock while Litestream is running. Synchronization around a checkpoint can fail until Litestream reinitializes the database. Restarting Litestream recreates the missing table automatically.

Contributing

We welcome bug reports, fixes, and patches! Please see our Contributing Guide for details on how to contribute.

Security

Please do not open a public issue for security vulnerabilities. Report them privately through GitHub's private vulnerability reporting, which keeps the report visible only to you and the maintainers until a fix is released. See our Security Policy for what to include and what to expect.

Acknowledgements

I want to give special thanks to individuals who invest much of their time and energy into the project to help make it better:

Huge thanks to fly.io for their support and for contributing credits for testing and development!

litestream (benbjohnson/litestream)

Searching Database…

What is this?Litestream is a standalone disaster recovery tool for SQLite: a background process that safely replicates database changes incrementally so you can recover after a failure.
So it's a one-off backup script, or something I keep running?You keep it running alongside your app — it streams changes incrementally as they happen, rather than taking snapshots on a schedule.
How do I get it running?The README sends you to the Litestream web site (litestream.io) for installation instructions and docs. The repo also ships a Dockerfile if you prefer containers.
Does it modify my database in any way?Yes — it creates an internal litestreamlock table in the source database to coordinate WAL checkpoints. That changes the schema and page count, so the database is no longer byte-identical to its pre-Litestream state.
Can I run it in Docker or on Kubernetes?Both: the repo includes a Dockerfile, and community docs cover running Litestream on Kubernetes. It's a single Go binary, with OpenBSD release builds available too.
Where do the replicas go — only S3, or other places too?The README names two destination types: another file or S3. Replication is incremental, so changes flow over continuously instead of as periodic full dumps.
Could Litestream corrupt my database?The project makes that a stated design point: it only communicates with SQLite through the SQLite API, and per the README it will not corrupt your database.
What happens if I drop the litestreamlock table while it's running?Checkpoint synchronization can fail until Litestream reinitializes the database. Restarting Litestream recreates the table automatically, but you shouldn't drop it mid-run.
If I restore a database, will the lock table end up in it too?Yes — because the source schema is backed up, restored databases also contain the table. It's expected and safe to leave in place.
Size
3.7 MB
Stars
14.5K
Age
6y
Commits · 90 Days