cd /news/data/bintrail-mysql-time-travel-queries-u… · home topics data article
[ARTICLE · art-7960] src=infoq.com ↗ pub= topic=data verified=true sentiment=· neutral

Bintrail: MySQL Time-Travel Queries Using Indexed Binlogs

Bintrail is a new open-source tool that enables time-travel queries and row-history lookups in MySQL by indexing binary logs and routing queries through ProxySQL, without requiring any modifications to MySQL or application code. It supports `AS OF` and `BETWEEN` queries for point-in-time data retrieval and change history, addressing a gap where MySQL lacks native temporal querying unlike Oracle, SQL Server, MariaDB, and PostgreSQL. The system independently stores indexed history, allowing queries across longer periods and integration with archived data on S3, while leaving normal MySQL traffic unaffected.

read3 min views15 publishedMay 21, 2026

Bintrail is a recently introduced layer that brings point-in-time queries and row-history lookups to MySQL, the only major relational database lacking native temporal querying. Using indexed binlogs behind ProxySQL and without modifying MySQL or application code, Bintrail supports querying data as of a past timestamp and reviewing change history, primarily for recovery and audit scenarios. The approach adds AS OF and BETWEEN time-travel queries to standard MySQL by combining ProxySQL-based query routing with indexed binary logs. Bintrail parses MySQL ROW-format binary logs, indexes every row event with full before/after images, and generates reversal SQL for point-in-time recovery without requiring the original binlog files. Daniel Guzman-Burgos, database specialist, explains why he started the project: Last month I mapped out how every major OLTP except MySQL gives you point-in-time queries out of the box. Oracle has AS OF TIMESTAMP. SQL Server has FOR SYSTEM_TIME AS OF. MariaDB ships system-versioned tables. PostgreSQL has three extensions that get you there. Source: dbtrail blog In Oracle and SQL Server, the historical state can be queried directly. In MySQL, recovering or inspecting past data states often becomes an operational task built around binary logs rather than native temporal querying. In a separate article comparing options for the most popular relational databases, the author argues that the practical gap between queryable history and raw log data is where many recovery and audit incidents occur. Guzman-Burgos adds: Flashback has been in Oracle for a quarter century. Temporal Tables landed in SQL Server a decade ago. CockroachDB shipped time travel on day one. PostgreSQL users reach for extensions because the gap is too obvious to ignore. MariaDB forked away from MySQL and built it there. Oracle MySQL didn’t, won’t, and has no incentive to. The _diff query returns all row-level changes over a specified time range, including event type, GTID, and before/after values. While SQL Server, MariaDB, and Oracle provide various forms of historical row queries, they typically expose stored row versions and depend on temporal storage or retention settings. In contrast, Bintrail reads directly from indexed MySQL binlogs to reconstruct the full sequence of changes for a row across any selected period. -- The state of order #42 at any past instant

SELECT * FROM _flashback.orders
AS OF '2026-04-15 09:30:00'
WHERE id = 42;
-- Or the whole table at that instant (every row that existed then)
SELECT * FROM _flashback.orders AS OF '2026-04-15 09:30:00';

-- Every change to order #42 in a time window

SELECT * FROM _diff.orders
BETWEEN '2026-04-15 00:00:00' AND '2026-04-15 23:59:59'
WHERE id = 42;

Bintrail can automatically generate ProxySQL routing rules that direct historical query patterns such as _flashback , _diff , and _snapshot to its own backend while leaving normal MySQL traffic untouched. The system maintains its own indexed history store independently of MySQL binlog retention, allowing historical queries to span longer periods and optionally extend into archived Parquet data stored on S3. Guzman-Burgos writes: No ALTER TABLE to enable system-versioning. No special storage engine. No binary log replay tooling. Same MySQL, same driver: point the connection at ProxySQL instead of the real MySQL port and the rest just works. Peter Zaitsev, founder of Percona and open source advocate, writes: Daniel Guzmán Burgos continues to do amazing work with efficient solutions for MySQL recoverability. Discussing the new option, Roman Agabekov, founder of Releem, notes: Restoring a full backup is often too heavy, too slow, and too risky. That matters even more now, as AI-generated SQL, automated scripts, and operational changes are moving faster than before. More automation increases speed. It also increases the need for precise recovery. Among the current limitations, Bintrail supports only literal timestamp queries, primary-key lookups, and capped full-table restores, while joins and more complex filtering must be handled outside the shim layer. Bintrail is available on GitHub under BUSL, a source-available license.

── more in #data 4 stories · sorted by recency
── more on @bintrail 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/bintrail-mysql-time-…] indexed:0 read:3min 2026-05-21 ·