Skip to content

Commit e641526

Browse files
dkamclaude
andcommitted
README: backup section — every database needs its own backup, plus WAL and restore caveats
The What to Backup list named all six SQLite files, but nothing said backup tools operate per-file — a single Litestream dbs: entry only replicates one database. Add an explicit warning, a four-DB Litestream example, a no-plain-cp-of-live-WAL-databases note, and a Restoring subsection (align restore points across DBs; dicts are stored in-file so each backup is self-contained). Also fix the sqlite3_rsync link to the official SQLite utility page. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 7cc1403 commit e641526

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,17 +582,23 @@ Configure Uptime Kuma to send alerts via:
582582

583583
## Backup
584584

585-
Splat uses SQLite databases. Two recommended backup strategies:
585+
Splat splits its data across **six separate SQLite database files**, and backup tools operate per-file — backing up `production.sqlite3` alone captures only projects and settings, not your errors, transactions, or logs. Every database you care about needs its own backup configuration.
586+
587+
Two recommended backup strategies:
586588

587589
**[Litestream](https://litestream.io/)** - Continuous replication to S3-compatible storage
588590
- Real-time backup with ~10-30 second lag
589591
- Supports AWS S3, Backblaze B2, Cloudflare R2, MinIO
590592
- Point-in-time recovery
593+
- Requires one `dbs:` entry per database file — a single entry replicates a single file
591594

592-
**[sqlite3_rsync](https://github.com/cannadayr/git/blob/master/sqlite3_rsync)** - Efficient incremental backups
595+
**[sqlite3_rsync](https://sqlite.org/rsync.html)** - Efficient incremental backups (official SQLite utility)
593596
- Creates byte-for-byte clones of live databases
594597
- Works while database is in use
595598
- Smaller incremental transfers than full copies
599+
- Run it once per database file
600+
601+
Do **not** back up a live database with plain `cp` or `rsync` — the databases run in WAL mode, and copying the `.sqlite3` file without a consistent snapshot of its `-wal` file produces a corrupt or stale copy. Use one of the tools above, or `sqlite3 <db> ".backup <dest>"`.
596602

597603
### What to Backup
598604
- `storage/production.sqlite3` - Application data: projects, settings, releases (critical)
@@ -602,6 +608,27 @@ Splat uses SQLite databases. Two recommended backup strategies:
602608
- `storage/production_cache.sqlite3` / `storage/production_cable.sqlite3` - Solid Cache / Cable (optional, regenerated at runtime)
603609
- `storage/tuber/` - Tuber's write-ahead log — only holds in-flight ingest jobs; not needed for a point-in-time restore
604610

611+
Example Litestream config covering all four critical databases:
612+
613+
```yaml
614+
# /etc/litestream.yml
615+
dbs:
616+
- path: /app/storage/production.sqlite3
617+
replicas: [{ url: s3://your-bucket/splat/production }]
618+
- path: /app/storage/production_issues_events.sqlite3
619+
replicas: [{ url: s3://your-bucket/splat/issues_events }]
620+
- path: /app/storage/production_transactions_spans.sqlite3
621+
replicas: [{ url: s3://your-bucket/splat/transactions_spans }]
622+
- path: /app/storage/production_logs.sqlite3
623+
replicas: [{ url: s3://your-bucket/splat/logs }]
624+
```
625+
626+
### Restoring
627+
628+
Restore all critical databases from (roughly) the same point in time. The issues/events, transactions/spans, and logs databases reference project IDs in the primary database, so wildly mismatched restore points leave rows pointing at projects that don't exist yet. There's no cross-file transaction to preserve, so second-level alignment is fine — just don't mix a week-old primary with today's events.
629+
630+
Each backup is self-contained: the zstd compression dictionaries used for event and log payloads are stored inside the same database file as the rows they compress, so a restored file is always readable on its own.
631+
605632
## Model Context Protocol (MCP) Integration
606633
607634
Splat exposes an MCP server that allows Claude and other AI assistants to query error tracking and performance data directly. As Splat has no authentication system, we'll use an environment set value for an authentication token.

0 commit comments

Comments
 (0)