Litestream introduced with implementation of replication system for SQLite

Ben Johnson, author of BoltDB NoSQL storage, introduced the Litestream project, which provides an add-on for organizing data replication in SQLite. Litestream does not require any changes to SQLite and can work with any application that uses this library. Replication is handled by a separately executed background process that tracks changes in files from the database and transfers them to another file or to external storage. The project code is written in Go and distributed under the Apache 2.0 license.

All interaction with the database is done through the regular SQLite API, i.e. Litestream does not directly interfere with work, does not affect performance, and cannot damage the contents of the database, which distinguishes Litestream from solutions such as Rqlite and Dqlite. Changes are tracked through the inclusion of a WAL-log ("Write-Ahead Log") in SQLite. To save storage space, the system periodically aggregates the flow of changes into slices (snapshots) of the database, on top of which other changes begin to accumulate. The time for creating slices is specified in the settings, for example, you can create slices once a day or once an hour.

As the main areas of application of Litestream, the organization of secure backups and the distribution of the read load on several servers are mentioned. You can migrate your change stream to Amazon S3, Azure Blob Storage, Backblaze B2, DigitalOcean Spaces, Scaleway Object Storage, Google Cloud Storage, Linode Object Storage, or any external host that supports SFTP. In case of damage to the contents of the main database, the backup copy can be restored from the state corresponding to the specified point in time, a certain change, the last change, or a given slice.

Source: opennet.ru

Add a comment