Bintrail: MySQL Time-Travel Queries Using Indexed Binlogs - InfoQ
BT
InfoQ Software Architects' Newsletter
A monthly overview of things you need to know as an architect or aspiring architect.
View an example
Enter your e-mail address
Select your country
Select a country
I consent to InfoQ.com handling my data as explained in this Privacy Notice.
We protect your privacy.
Close
Helpful links
About InfoQ
InfoQ Editors
Write for InfoQ
About C4Media
Diversity
Choose your language
En
中文
日本
Fr
Online InfoQ Architect Certification<br>The more senior you become, the fewer people pressure-test your decisions. This 5-week cohort gives you that check.
Register Now.
QCon AI Boston<br>Learn how leading engineering teams run AI in production—reliably, securely, and at scale.
Register Now.
Online InfoQ AI Engineering Certification<br>A practical online cohort for senior engineers making decisions around retrieval, agents, evals, and AI infrastructure.
Register Now.
QCon San Francisco<br>Learn what's next in AI and software, from teams already doing it.
Register Now.
InfoQ Homepage
News
Bintrail: MySQL Time-Travel Queries Using Indexed Binlogs
AI, ML & Data Engineering
Bintrail: MySQL Time-Travel Queries Using Indexed Binlogs
May 21, 2026
min read
by
Renato Losio
Write for InfoQ
Feed your curiosity.<br>Help 550k+ global<br>senior developers<br>each month stay ahead.Get in touch
Listen to this article - 0:00
Audio ready to play
Your browser does not support the audio element.
0:00
0:00
Normal1.25x1.5x
Like
Reading list
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<br>SELECT * FROM _flashback.orders<br>AS OF '2026-04-15 09:30:00'<br>WHERE id = 42;
-- Or the whole table at that instant (every row that existed then)<br>SELECT * FROM _flashback.orders AS OF '2026-04-15 09:30:00';
-- Every change to order #42 in a time window<br>SELECT * FROM _diff.orders<br>BETWEEN '2026-04-15 00:00:00' AND '2026-04-15 23:59:59'<br>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...