Quick Start
Lightweight SQLite WAL sync to S3 in Rust.
Why Walrust?
Section titled “Why Walrust?”Walrust is built for curiosity, efficiency, and Rust-native integration.
Curiosity
Section titled “Curiosity”I built walrust because I was interested in it, and because I was doing silly things with millions of databases on a single server. Think a SaaS platform where every customer gets their own SQLite database - I needed the lowest memory overhead possible and the fastest sync possible (see redlite).
Memory Efficiency
Section titled “Memory Efficiency”Walrust’s Rust implementation has a smaller memory footprint:
Measured overhead:
- walrust: ~12 MB baseline
- Litestream: ~33 MB baseline
For resource-constrained environments (small VMs, containers, edge deployments), this difference matters.
Rust-Native
Section titled “Rust-Native”Walrust integrates naturally into Rust projects:
- Native async/await with tokio
- No CGO dependencies
- Smaller binary size (~8 MB)
Installation
Section titled “Installation”CLI (Rust)
Section titled “CLI (Rust)”cargo install walrustPython
Section titled “Python”pip install walrustVerify
Section titled “Verify”walrust --versionSet Up Credentials
Section titled “Set Up Credentials”Configure your S3 credentials. Example for Tigris (Fly.io):
export AWS_ACCESS_KEY_ID=tid_xxxxxexport AWS_SECRET_ACCESS_KEY=tsec_xxxxxexport AWS_ENDPOINT_URL_S3=https://fly.storage.tigris.devSee S3 Providers for AWS, R2, MinIO, and other providers.
Take a Snapshot
Section titled “Take a Snapshot”Back up your database to S3:
walrust snapshot myapp.db --bucket my-backupsOutput:
Snapshotting myapp.db to s3://my-backups/myapp.db/...✓ Snapshot complete (1.2 MB, 445ms) Checksum: a3f2b9c8d4e5f6a7...Watch for Changes
Section titled “Watch for Changes”Continuously sync WAL changes:
walrust watch myapp.db --bucket my-backupsThis watches for database changes and syncs them to S3. Run this as a background service in production.
Restore
Section titled “Restore”Restore a database from backup:
walrust restore myapp.db --bucket my-backups -o restored.dbOutput:
Restoring myapp.db from s3://my-backups/... Downloading snapshot... done (1.2 MB) Verifying checksum... ✓✓ Restored to restored.dbWatch Multiple Databases
Section titled “Watch Multiple Databases”Sync multiple databases with a single process:
walrust watch app.db users.db analytics.db --bucket my-backupsCreate a Read Replica
Section titled “Create a Read Replica”Run a local read replica that polls S3 for changes:
walrust replicate s3://my-backups/myapp.db --local replica.db --interval 5sOutput:
Replicating s3://my-backups/myapp.db -> replica.dbPoll interval: 5sPress Ctrl+C to stop
Bootstrapped from snapshot: 1024 pages, TXID 100[10:30:05] Applied 1 LTX file(s), now at TXID 101The replica auto-bootstraps from the latest snapshot if it doesn’t exist, then applies incremental updates.
Next Steps
Section titled “Next Steps”- Why Walrust? - Multi-tenant SQLite use case
- CLI Reference - Full command documentation (including
replicate) - Configuration - Environment variables and options
- Deployment - systemd, Docker, Kubernetes guides