mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 05:59:14 +00:00
1.1 KiB
1.1 KiB
Litestream in-process replication and lightweight read-replicas
This package adds EXPERIMENTAL support for in-process Litestream.
Lightweight read-replicas
The "litestream" SQLite VFS implements Litestream
lightweight read-replicas.
See the example for how to use.
To improve performance,
increase PollInterval (and MinLevel) as much as you can,
and set PRAGMA cache_size=N
(or use _pragma=cache_size(N)).
In-process replication
For disaster recovery, it is probably best if you run Litestream as a separate background process, as recommended by the tutorial.
However, running Litestream as a background process requires compatible locking and cross-process shared memory WAL (see our support matrix).
If your OS lacks locking or shared memory support,
you can use NewPrimary with the sqlite3_dotlk build tag to setup in-process replication.