跳到正文
FunCoding

dbtrail

官方 MCP Registry 已收录

MySQL change tracking with instant row-level recovery and forensic attribution for compliance.

Star
77
分类
数据库
版本
v0.1.0
许可证
Apache-2.0
最近提交
2026年12月1日
Heavy reports, from minutes to seconds. Your reports run on a columnar copy that DBTrail keeps up to date, not on your server. Connect with the client you already use. For PostgreSQL 15 to 18, RDS and Aurora; for MySQL 8.0+, RDS, Aurora, Percona and MariaDB.

Transactions stay on your server. Heavy reports come back in seconds from a near real time columnar copy, routed on the same connection, with no ETL and nothing installed on your server.

PostgreSQL →    MySQL and MariaDB →

Release License CI

Website · Quick Start · Docs · Blog

PostgreSQL

Reports run on a near real time columnar copy of your tables, and your application keeps one connection: DBTrail's port 5433 answers as PostgreSQL, sends small questions to your database and answers heavy reports from the copy. DBTrail reads your changes with the built-in pgoutput; nothing is installed in PostgreSQL. PostgreSQL 15 to 18, Amazon RDS and Aurora.

Try it in one command, with Docker:

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

Or install it on a server, without Docker (Ubuntu 22.04 or 24.04, Debian 12, Amazon Linux 2023, RHEL, Rocky Linux or AlmaLinux 9). It runs as system services and sets up its own history store; there is nothing to prepare:

curl -fsSL https://raw.githubusercontent.com/dbtrail/dbtrail/main/install-server.sh | sudo DBTRAIL_FOR=postgres sh
psql "host=<dbtrail host> port=5433 dbname=shop user=app sslmode=require"

dbtrail.com/postgresql · Get started with PostgreSQL

MySQL and MariaDB

mysql -h <dbtrail host> -P 3309 -u shop -p
SELECT c.tier, count(*) AS orders, round(sum(o.total), 2) AS revenue
FROM orders o JOIN customers c ON c.id = o.customer_id
GROUP BY c.tier ORDER BY revenue DESC;

The same SQL your application sends. DBTrail answered it from the copy, and your MySQL never ran it.


What you can do

  • Run heavy queries in seconds. Totals and rankings over whole tables, trends over years of data, page 5,000 of a listing. In our test, the heaviest of 14 real reports took 225 seconds on a MySQL replica and 7.9 with DBTrail; the 14 ran 6.5 times faster on average. The numbers
  • Keep one connection for your application. With routing on, DBTrail sends writes, transactions and lookups by key to your MySQL, and answers the heavy reads from the copy. Your application's SQL stays as it is. It also works behind ProxySQL. Connect your application
  • Point dashboards at it. Metabase, Grafana or any tool that speaks MySQL. Dashboards
  • Undo a wrong change. DBTrail keeps every change on your MySQL server, before and after, and writes the SQL that undoes the ones you didn't want. You review it and you run it. Undo a wrong change
  • See a table as it was yesterday at 14:30, or every version of one row, with AS OF from your mysql client. To try it in 30 seconds with nothing of yours connected: docker run --rm -p 6033:6033 ghcr.io/dbtrail/bintrail-demo (the demo image). Restore tables to a moment
  • Ask Claude what changed. Connect Claude, or any MCP client, and ask in plain words: "what was deleted from orders in the last hour?", "how did customer 42 look on Monday?", "give me the SQL that puts it back". Its tools only read, and it never runs SQL on your MySQL. Connect Claude

Where it runs

DBTrail reads your binlog over the replication protocol, the way a replica does. Nothing is installed on your MySQL: no plugin, no agent, no triggers. You don't move to another database or another cloud. DBTrail runs on your own machines, next to MySQL, Percona Server, MariaDB, Amazon RDS or Aurora, and the copy is plain Parquet files on your disk or in your S3 bucket.

Install

Two ways, the same DBTrail. You need the mysql client for both.

Try it in one command, with Docker and Compose:

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

Install it on a server, without Docker (Ubuntu 22.04 or 24.04, Debian 12, Amazon Linux 2023, RHEL, Rocky Linux or AlmaLinux 9). DBTrail runs as system services, and the installer sets up its own MySQL 8.4 for the history, apart from any MySQL on the machine. There is nothing to prepare:

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

Either one starts DBTrail on http://127.0.0.1:8090 and prints the next steps as commands to paste. Connect your MySQL in the form, take the first copy, turn on the MySQL port, and run a heavy query: the five steps are in the Quick Start.

For a server you keep running, the same setup as a compose file and a few API calls you can keep in your automation: In production. Linux packages and Amazon ECS too. The installation without Docker, what it puts where, and how to remove it: Install on a Linux server.

Limits

  • The copy is near real time. A query that must see a write made a second ago belongs on your MySQL, and routing keeps transactions there.
  • Lookups stay on your MySQL. A read by key takes a few milliseconds on MySQL and about 100 on the copy, so routing leaves it on your MySQL.
  • Not high availability, and not your backup. Your data stays on your MySQL and nothing fails over to DBTrail. An application that connects to DBTrail's MySQL port depends on that port: while it is down the application gets connection errors there, with MySQL up and untouched. Keep a way to MySQL that does not pass through it, or a proxy in front that falls back to MySQL: When the router stops. History starts the day you install it. Keep your replicas and your backups.
  • Needs a ROW binlog with full row images (binlog_format=ROW, binlog_row_image=FULL). The connect form checks the binlog settings and shows the fix. A table is captured when it is InnoDB with a primary key; a table without one is left out and named with its fix, and the other tables are captured.
  • Some schema changes re-read a table. Adding or dropping a column, or a TRUNCATE, makes DBTrail read that table again, with a short lock.
  • Row history needs a bucket to last. Without S3 it keeps 48 hours. The copy itself stays.
  • The MySQL port's TLS is verifiable only with your certificate. Without one, a client that asks for TLS gets it, with a certificate made up at start that it cannot verify. Give the router yours (--tls-cert, --tls-key) and clients can connect with --ssl-mode=VERIFY_IDENTITY. The port offers TLS and does not require it. See TLS on the port.
  • Yours to operate. DBTrail and its small index MySQL run on your machines. Disk, backups and upgrades are yours.

All of them: Limitations.

What it works with

SourceAnalytical copyRow history and undo
MySQL 8.0, 8.4, 9.7YesYes
Percona Server for MySQL 8.0, 8.4, 9.7YesYes
Amazon RDS for MySQLYes (verified)Yes (verified)
Amazon Aurora MySQLYes (verified)Yes (verified)
Google Cloud SQL for MySQLShould work, please report issuesShould work
MariaDB 10.11+, including Amazon RDS for MariaDBYesYes. See MariaDB source
PostgreSQL 15+Yes. Scheduled updates run, and a table added to the publication later is read inYes. See PostgreSQL source

On PostgreSQL, DBTrail captures a table only at REPLICA IDENTITY FULL. On PostgreSQL 18, a table with a VIRTUAL generated column cannot be at FULL, so it cannot be captured, and a table with a STORED one needs publish_generated_columns = stored on the publication to be. See PostgreSQL source.

DBTrail never needs the binlog files on disk, which is why managed cloud databases work.

Each DBTrail installation serves one database family: MySQL and MariaDB, or PostgreSQL. See one database family per installation.

Who builds it

DBTrail is built by Daniel Guzman-Burgos, former MySQL Technical Lead at Percona.

Documentation

The guides live at dbtrail.com/docs. This repository keeps the reference for the command line and for operators:

Use itOperate itReference
Command-line quickstartInstall · DeploymentTime-Travel SQL
DBA guideCapacity · UpgradingQuery & Recovery
Analytics with DuckDBDocker · Upload to S3MCP server
Iceberg exportRotation & StatusMariaDB source · PostgreSQL source

Privacy

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.

License

Apache-2.0: free for any use, including commercial and production. Contributions are welcome; see CONTRIBUTING.md. Each commit carries a Signed-off-by line (DCO); git commit -s adds it.

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.

同类 MCP Server

dbx

Query databases from AI agents using connections configured in DBX.

T8t8y2/dbx32k近 7 天新增 726 个 star

Windmill

Run Windmill scripts and flows and manage jobs, schedules, resources and variables.

WIwindmill-labs/windmill19k近 7 天新增 82 个 star

MCP Toolbox for Databases

MCP Toolbox for Databases enables your agent to connect to your database.

GOgoogleapis/mcp-toolbox17k近 7 天新增 77 个 star

nightingale

Open-source, self-hosted alerting for metrics, logs, and databases. Includes a built-in AI agent and MCP server.

CCccfos/nightingale14k近 7 天新增 10 个 star

mcp

Real-time Kubernetes network traffic visibility and API analysis for HTTP, gRPC, Redis, Kafka, DNS.

KUkubeshark/kubeshark12k近 7 天新增 5 个 star

Nhost

Let your users work with their own data through an AI assistant, limited to what they can see.

NHnhost/nhost9.4k近 7 天新增 1 个 star