Back to Devoured - June 25, 2026
DEVOURED
dbtrail (GitHub Repo)

dbtrail (GitHub Repo)

Data GitHub
dbtrail provides point-in-time recovery for MySQL by streaming binary logs into a searchable index, enabling time-travel queries without restore operations.
What: The tool tracks every row change with before/after images, allowing developers to generate reversal SQL, recover cascade-deleted rows, and query data as it existed at any historical timestamp.
Why it matters: Traditional MySQL recovery is slow and destructive; this approach enables surgical recovery of specific data states without locking the production database or rolling back the entire instance.
Takeaway: If you are running MySQL 8.0+, use `bintrail doctor` to check your configuration, then deploy the container to start tracking row-level history.
Decoder
  • Binary Log (binlog): A set of log files that contain information about data modifications made to a MySQL server instance.
  • Point-in-Time Recovery (PITR): The ability to restore a database to a specific millisecond in the past.
  • MCP (Model Context Protocol): An open standard for connecting AI assistants to data and tools, allowing LLMs to interact directly with internal systems.
Original article

Point-in-time recovery for MySQL — no locks, no schema changes, no waiting for a restore.

SELECT * FROM orders WHERE id = 123 AS OF '2026-05-20 14:00:00'

— against production MySQL. That's the experience dbtrail makes possible.

What you get

dbtrail tails the MySQL binary log and keeps every row change with full before/after images in a searchable index:

  • See every change — what changed and when, for every row, with before → after diffs
  • Undo precisely — generate exact reversal SQL for just the damaged rows
  • Undo cascade deletes — reconstruct child rows an ON DELETE CASCADE wiped out (and restore FKs an ON DELETE SET NULL cleared) that InnoDB removes below the binlog and most tools can't see.
  • Time-travel — query any row (or table) as it was at any moment.
  • Web console — browse, recover, and add servers to monitor, all in the UI
  • MCP server — Claude or any MCP client can search history and draft recoveries

Works with MySQL, Percona Server for MySQL, Amazon RDS for MySQL, Amazon Aurora MySQL, and Google Cloud SQL for MySQL — dbtrail connects over the replication protocol, so it never needs the binlog files on disk. Requires MySQL 8.0+ with binlog_format=ROW and binlog_row_image=FULL; bintrail doctor checks both and prints the exact fix.

Install

curl -fsSL https://raw.githubusercontent.com/dbtrail/dbtrail/main/install.sh | sh

This downloads the Compose stack, brings it up, waits for the console, and prints what to do next. Then:

  1. Open http://127.0.0.1:8090 — on first run, create a username and password (that's your login from now on).
  2. Click + Add server and paste the MySQL you want to watch — host, user, password. dbtrail runs preflight checks, provisions an index, and starts streaming within the minute.

Just curious? One container, zero setup, time-travel SQL in 30 seconds:

docker run --rm -p 6033:6033 ghcr.io/dbtrail/bintrail-demo

License

Apache-2.0 — free for any use, including commercial and production. Contributions welcome.

Explore all 57 articles in today's digest

Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi