Restore any Postgres database to any second.
Tarn keeps continuous snapshots of your database in your own storage and brings it back to the exact second you name, with one command.
Install to restore in three commands
Tarn runs beside your database, streams its write-ahead log to your bucket, and rebuilds any moment on demand.
-
Install
One binary for macOS and Linux. Nothing runs on the database host.
✓ tarn 2.4.0 installedRun tarn connect to attach your first database.brew install tarn -
Connect
Point Tarn at a database and a bucket. It takes a base snapshot, then follows every write.
✓ Connected to orders (Postgres 17.2, 182 GB)✓ Base snapshot written in 3m 12s✓ Following the write-ahead logtarn connect postgres://app@db.example.com/orders --store s3://acme-backups/orders -
Restore
Name a database and a moment. Tarn restores into a new database, so production is never touched.
· Nearest snapshot 09:00:00· Replaying 14m 07s of log✓ Restored to orders_0914 in 41starn restore orders --to "2026-11-02 09:14:07"
Eight commands, one job
Each one prints what it did and what to run next. Add --help to any of them for every flag.
tarn --help
Usage: tarn <command> [flags]
- connect
- Attach a database and a storage bucket.
- restore
- Rebuild any second into a new database.
- snapshot
- Take a base snapshot now, off schedule.
- branch
- Make a writable copy of any moment.
- verify
- Restore in the background and check it.
- list
- Show snapshots, log coverage, and gaps.
- prune
- Remove what falls outside your keep rule.
- status
- Report lag, storage, and the last check.
Restore time grows with the log, not the database
Tarn starts from the nearest snapshot, so a terabyte comes back in minutes.
| Size | Restore | Relative time |
|---|---|---|
| 10 GB | 9s | |
| 50 GB | 18s | |
| 100 GB | 41s | |
| 500 GB | 2m 48s | |
| 1 TB | 5m 31s |
Median of 20 restores per size, each replaying 15 minutes of log, on a 16-core host with Postgres 17.2. November 2026.
One file, checked in beside your code
Tarn reads tarn.toml from the working directory. Three keys do most of the work.
every = "15m"A base snapshot every 15 minutes. The log covers each second in between.keep = "30d"Anything older than 30 days is pruned on the next run.encrypt = trueData is encrypted with your key before it leaves the host.
[database]url = "postgres://app@db.example.com/orders"[snapshots]every = "15m"keep = "30d"[storage]store = "s3://acme-backups/orders"encrypt = true
Changelog
A release every few weeks. Every one is signed and backwards compatible.
- v2.4.0Restore to a second inside a long-running transaction.
- v2.3.2Faster replay for tables with large JSON columns.
- v2.3.0New tarn branch command makes a writable copy of any moment.
- v2.2.0tarn verify now runs on a schedule.
Start with one line
curl -fsSL https://tarn.example/install.sh | sh