
Connects to a MySQL binlog index (built by the Bintrail CLI) and exposes query, recover, and status tools so Claude can search row-level change history and generate reversal SQL. Useful when you need to investigate what changed in production, who made a specific update, or generate point-in-time recovery scripts without manually writing SQL against the binlog_events table. The server is read-only and works with Bintrail's streaming or file-based indexing modes. Ships with the main Bintrail distribution and can run via the Claude Connector (with the MCP Gateway) or locally through go run. Requires an existing Bintrail index database, it doesn't stream binlogs directly.
DBTrail keeps your MySQL tables as Parquet files you own, minutes behind the source, with every version of every row. Query them with DuckDB. Production never sees the query.
$ duckdb -init views.sql
D SELECT c.tier, count(*) AS orders, round(sum(o.total), 2) AS revenue
FROM demo.orders o
JOIN demo.customers c ON c.id = o.customer_id
GROUP BY c.tier ORDER BY revenue DESC;
┌──────────┬────────┬───────────────┐
│ tier │ orders │ revenue │
│ varchar │ int64 │ decimal(38,2) │
├──────────┼────────┼───────────────┤
│ platinum │ 539848 │ 59426197.40 │
│ gold │ 539752 │ 59353658.54 │
│ silver │ 539056 │ 59295443.48 │
│ bronze │ 538385 │ 59242795.95 │
└──────────┴────────┴───────────────┘
That query read Parquet files. The MySQL primary never saw it.
Minutes behind the source. Not high availability, not a backup. Limits
Reports, dashboards and ad-hoc analysis compete with your application when
they run on the primary: a full scan pushes the working set out of the buffer
pool, a long read holds back purge, and a GROUP BY over millions of rows
spills temp tables to disk. A reporting replica is one more MySQL to pay for
and patch, and it still answers at row-store speed.
DBTrail gives those queries a copy of their own, in a columnar format, outside
mysqld.
views.sql gives you one view
per table, named like the source table (shop.orders), that follows
the newest snapshot.One Docker Compose stack, and a folder or an S3 bucket. No pipeline to build, no warehouse to run, no Kafka. See Analytics with DuckDB.
Source: RDS MySQL 8.4, TPC-C dataset, 73 million rows, about 10 GB, under a sysbench-tpcc load of 180 transactions per second. Measured 18 to 20 September 2026 with DBTrail 0.84 refreshing every 5 minutes. Six report queries, total time:
| Where the queries ran | Total time |
|---|---|
| MySQL | 22 min 28 s |
| ClickHouse fed by Airbyte CDC | 12.6 s |
| DBTrail + DuckDB | 4.6 s |
| MyDuck Server | 2.7 s |
One of the six, a two-table join grouped by district and month, took 3 min 52 s on MySQL and 0.9 s on the copy. MyDuck was faster on this set: it keeps data in DuckDB's own format, which only DuckDB reads.
Freshness, measured separately under about 340 transactions per second with a 5-minute schedule: commit to visible in DuckDB took 2.7 to 13.2 minutes, median 5.9.
Method, cost comparison and ClickBench results: Introducing the MySQL Analytical Replica.
mysqld.views.sql, one view per table. Your DuckDB
runs it on your machine: a laptop, a notebook, a BI box.bintrail export iceberg. See Iceberg export.Open the copy through
views.sql. An engine that reads the Parquet files directly sees each table as of its last full write and can miss the change files stored beside it. The views apply them for you.
DBTrail keeps every change on your MySQL server, before and after, and writes the SQL that undoes the ones you didn't want. It reads them from the same binlog as the copy, from the day you install it:
reconstruct CLI. An optional MySQL
port (beta) answers the same questions with AS OF SQL from any mysql
client. See Time-Travel SQL.recover-cascade also rebuilds the child rows an ON DELETE CASCADE
removed below the binary log. DBTrail writes the SQL. You review it and you
run it. See Query & Recovery.bintrail verify checks, from two snapshots and the
index and without touching the source, that a recovery would reproduce it.
bintrail status flags any gap the capture could not fill.
See Verify.Try time travel in 30 seconds, with nothing of yours connected:
docker run --rm -p 6033:6033 ghcr.io/dbtrail/bintrail-demo
See the demo image.
A copy you can trust is one whose edges you know.
binlog_format=ROW and
binlog_row_image=FULL. bintrail doctor checks both and prints the fix
(on RDS and Aurora, set them in the parameter group).TRUNCATE, DROP or RENAME of a table, pauses the scheduled
update until DBTrail reads the database again, at most once a day. That read
takes a short lock: a global read lock while it starts, or, on RDS and
Aurora, a lock on the tables it reads. A new table joins with a read of its
own. Index and other everyday changes do not trigger one.--rotate-retain changes it). The copy itself stays: the newest
3 snapshots per table on local disk.recover-cascade rebuilds most of them,
and the copy keeps them until DBTrail next reads the database in full.Full list: Limitations.
| Source | Analytical copy | Row history and undo |
|---|---|---|
| MySQL 8.0, 8.4 | Yes | Yes |
| Percona Server for MySQL 8.0, 8.4 | Yes | Yes |
| Amazon RDS for MySQL | Yes (verified) | Yes (verified) |
| Amazon Aurora MySQL | Yes (verified) | Yes (verified) |
| Google Cloud SQL for MySQL | Should work, please report issues | Should work |
| MariaDB 10.11+, including Amazon RDS for MariaDB | Yes | Yes. See MariaDB source |
| PostgreSQL 14+ | One-time copy only, no scheduled update yet | Beta. See PostgreSQL source |
DBTrail never needs the binlog files on disk, which is why managed cloud databases work.
You need Docker with Compose, and DuckDB on the machine where you query.
curl -fsSL https://raw.githubusercontent.com/dbtrail/dbtrail/main/install.sh | sh
This downloads the Docker Compose stack, starts it, waits until DBTrail answers, and prints the next steps.
.tar.gz and run duckdb -init views.sql
inside the snapshot folder. To read the copy that keeps updating, see
Query in DuckDB.Prefer the command line? See the command-line quickstart.
DBTrail is built by Daniel Guzman-Burgos, former MySQL Technical Lead at Percona.
bintrail is DBTrail's command-line tool. It runs entirely in your
infrastructure. Your database data never leaves it: not your rows,
schemas, table names, queries, hostnames, DSNs, or file paths.
Official release builds do report metadata-only usage statistics: which command ran, whether it succeeded, a coarse error class, and your version and platform. It is on by default and turns off in one line:
bintrail telemetry off # or: DO_NOT_TRACK=1, BINTRAIL_TELEMETRY=off
bintrail telemetry show # prints what would be sent; sends nothing
No identifier of any kind is stored or transmitted, so nothing ties those statistics to you or your machine. A binary you build yourself has no reporting address compiled in and cannot send anything. TELEMETRY.md documents every field, every control, and the CI tests that enforce both.
The privacy policy covers the Claude Desktop extension (.mcpb),
which reports nothing at all, and how data moves when an AI client queries
your deployment.
Apache-2.0: free for any use, including commercial and production. Contributions are welcome; see CONTRIBUTING.md (a CLA is required, prompted automatically on your first PR).
Want the index server operated for you (sized, backed up, upgraded, kept alive on-call) instead of running it yourself? That is the managed service at dbtrail.com. SUPPORT.md draws the ship-vs-operate line.