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…

这是什么东西?Litestream 是一个独立的 SQLite 灾难恢复工具:它是一个后台进程,会安全地以增量方式复制数据库的变更,这样发生故障后你就能恢复数据。
它是那种一次性备份脚本,还是需要我一直运行的东西?你需要让它和你的应用一起持续运行 —— 变更一旦发生就实时增量地传输过去,而不是按固定时间做快照。
我怎么把它跑起来?README 会引导你前往 Litestream 的网站(litestream.io)查看安装说明和文档。如果你更喜欢用容器,仓库里还附带了一个 Dockerfile。
它会以任何方式改动我的数据库吗?会 —— 它会在源数据库里创建一个内部的 litestreamlock 表,用来协调 WAL 检查点。这会改变数据库的表结构和页数,所以数据库不再和接入 Litestream 之前逐字节完全一致。
我能在 Docker 或 Kubernetes 上运行它吗?都可以:仓库里包含 Dockerfile,社区文档也介绍了在 Kubernetes 上运行 Litestream 的方法。它是一个单独的 Go 二进制文件,也提供 OpenBSD 的发布版本。
副本存到哪里 —— 只能存到 S3,还是也能存到别的地方?README 提到了两种目标类型:另一个文件或 S3。复制是增量进行的,变更会持续不断地传过去,而不是定期做完整导出。
Litestream 会损坏我的数据库吗?项目明确把这一点作为设计原则:它只通过 SQLite API 与 SQLite 通信,而且按照 README 的说法,它不会损坏你的数据库。
如果它在运行时我把 litestreamlock 表删掉了会怎样?在 Litestream 重新初始化数据库之前,检查点同步可能会失败。重启 Litestream 会自动重建这张表,但你不应该在运行中途删掉它。
如果我恢复一个数据库,那张锁表也会跟着出现在里面吗?会 —— 因为源数据库的表结构也被备份了,恢复出来的数据库里同样包含这张表。这是正常现象,保留在那里是安全的。
Size
3.7 MB
Stars
14.5K
Age
6y
Commits · 90 Days