Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Enabling "time travel queries" in MySQL with Bintrail — architecting custom database forensics services in 2026

Table of contents · 11 items

On May 21, 2026, InfoQ published Bintrail: MySQL Time-Travel Queries Using Indexed Binlogs. Bintrail is an open-source layer operating behind ProxySQL that leverages indexed binlogs to retrofit MySQL with point-in-time data querying and row-level history tracking. Because it delivers time-travel queries without requiring any modifications to MySQL core or application code, it dramatically expands options for forensics, auditing, and incident investigations.

For providers supporting core enterprise systems for mid-market clients through custom development, this means that "even MySQL, which lacks temporal tables like PostgreSQL, can support full-fledged audit infrastructure." Beyond the MySQL core upgrades explored in MySQL 9.7 LTS SMB Custom Modernization, it adds the distinct dimension of point-in-time historical data querying. This article outlines the architecture and deployment procedures for building a DB forensics foundation in MySQL using Bintrail.

Why MySQL Came to Need "Time-Travel Queries"

DimensionTraditional MethodsBintrail
Point-in-Time QueriesFull backup restoration → Spinning up a separate DBAS OF '2026-05-01 12:00'-style specification in SQL
Row-by-row historyAudit tables implemented in application layerAutomatic reconstruction from binlog
MySQL modificationsSchema additions and trigger implementation requiredNot required (indexing only)
Application modificationsAudit logging added at ORM levelNot required (via ProxySQL)
StorageDoubled due to audit tablesReuse of existing binlog
PCI / SOC 2 compliancePartial complianceFull compliance achievable
Incident investigation speedSeveral hours to several daysA few minutes

In other words, Bintrail is positioned to upend conventional wisdom in audit infrastructure design by "achieving point-in-time reference plus row history without modifying MySQL schemas or applications."

Three structural shifts driven by Bintrail

Structural shift 1: From full backup restoration to instant time travel

Previously, a request like "I want to view the customer master from 2:00 PM last Tuesday" required several hours to half a day of work: restoring a full backup, launching a separate database, and executing queries. With Bintrail, you can retrieve it instantly using SELECT * FROM customers AS OF '2026-05-15 14:00'-style SQL.

Structural shift 2: From implementing audit logs in applications to absorbing them at the ProxySQL layer

To satisfy audit requirements, having the application record before-and-after values in separate tables was a common pattern, but this caused a triple burden of application modifications, testing costs, and bloated audit tables. Because Bintrail absorbs this at the ProxySQL layer, you can design a system where the application remains completely untouched.

Structural shift 3: From migrating to PostgreSQL to meeting audit requirements while staying on MySQL

Until now, migrating to PostgreSQL (temporal tables), Oracle, or SQL Server was often debated to meet audit requirements. With Bintrail, you can achieve equivalent capabilities while staying on MySQL, providing a practical solution for data governance like the one we addressed in Monzo Governed Data Mesh client development.

Five phases of Bintrail + MySQL DB forensics implementation

Phase 1: Current state assessment (2 weeks)

  • Inventory of existing MySQL clusters (versions, replica configurations, binlog settings)
  • Identification of audit requirements (PCI, SOC 2, ISMS, PrivacyMark)
  • Review of incident response history (how many man-hours were spent in the past)
  • Inventory of existing audit log implementations (application layer / trigger layer)
  • Feasibility of introducing an intermediary layer like ProxySQL or HAProxy

Phase 2: Design (1–2 weeks)

  • Configuration design for placing Bintrail behind ProxySQL
  • Determining binlog retention period + index retention period
  • Storage estimation (S3, EBS, GCS)
  • Extracting critical tables (customers, orders, payments, permissions)
  • Access control (read-only roles + auditing roles)
  • Decommissioning plan for existing audit log implementations

Phase 3: Phased rollout (3–4 weeks)

  • Installing Bintrail in validation environments
  • Routing existing applications through ProxySQL with zero downtime
  • Load testing for indexing (impact on primary)
  • Search performance benchmarking
  • Production canary deployment (one cluster → all clusters)

Phase 4: Operational foundation building (2–3 weeks)

  • Creating a collection of audit query templates (common incidents)
  • Time travel SQL training (client SRE / security teams)
  • Dashboard construction (Grafana, Metabase)
  • Formatting monthly forensics reports
  • Escalation procedures during incidents

Phase 5: Monthly forensics review (ongoing)

  • Verifying audit requirement fulfillment
  • Monitoring mean time to resolution for incident responses
  • Optimizing binlog retention periods + storage costs
  • Updating audit query templates
  • Submitting audit reports

Standard technology stack set for custom development

LayerRecommended technologyAlternative
Core DBMySQL 8.4 LTS / 9.7 LTSMariaDB 11.6
Time travel layerBintrailDebezium + ClickHouse
IntermediaryProxySQLHAProxy + MaxScale
Binlog storageS3 / GCS (lifecycle management)Dedicated EBS / NFS
IndexesBuilt-in to BintrailOpenSearch / Elasticsearch
VisualizationGrafana + MetabaseLooker
Audit role managementMySQL native roleHashiCorp Vault
AlertingPagerDuty / SlackOpsgenie

Which projects need this and which do not

Projects requiring thisProjects not requiring this
Running MySQL in production + audit requirements existSmall scale with zero audit requirements
Compliance with PCI / SOC 2 / ISMSNot subject to regulations
Frequent incident investigationsSimple read-heavy workload
Handles customer master, payments, and permissionsTemporary data only
Requests for "point-in-time queries" have emergedBackup restoration is sufficient

Six clauses to include in client contracts

ClauseDetailsWhat the client should verify
Retention period SLABinlog / index retention periodAlignment with statutory retention periods
Search performance SLAQuery response time for past N daysRequired speed during audit investigations
Storage cost allocationCost boundaries between client and contractorSettlement rules upon scaling
Incident SLATime from detection to investigation startResponse speed by severity level
Audit reportMonthly / audit-time deliverablesLegal / auditor review
Offboarding handoverBinlog + indexes + rolesInternal operational continuity

ROI estimate (assumes 6 MySQL clusters with audit requirements)

ItemExisting operations (current state)With BintrailDifference
Incident investigation time per case16 hours on average1.5h-14.5h
Incidents per year12 incidents12 incidentsSame
Backup restoration effort per year60h8h-52h
Audit table operational effort per month30h5h-25h
Failed audits / lost deal opportunitiesScale of ~1 incident/year0 incidentsTens of millions of yen
Annual benefitApprox. 18 million yen equivalent + preserved trust

Calculated at an hourly rate of 8,000 yen, this delivers an annual labor cost reduction of over 14.4 million yen. Factoring in the prevention of lost business opportunities due to failed audits lowers the investment threshold even further. Because implementation and operational costs vary significantly depending on cluster scale, please treat this estimate strictly as a rough benchmark for potential benefits.

Five common pitfalls

Pitfall 1: Leaving the binlog format set to STATEMENT

Bintrail requires the binlog format to be ROW. If it is set to STATEMENT or MIXED, historical row values cannot be fully reconstructed, making changing the binary log format an absolute prerequisite.

Pitfall 2: ProxySQL as a single point of failure

Deploying ProxySQL as a single instance means all queries routed through Bintrail will fail if it goes down. An HA setup + automatic failover is essential.

Pitfall 3: Neglecting index bloat

Bintrail's indexes bloat in proportion to table update frequency. You must incorporate monthly size monitoring + archive procedures for old indexes into your operations.

Pitfall 4: Granting full permissions to the forensics team in access control

The authority to view historical data is a powerful privilege. Unless you build separation between auditing and viewing roles + audit logging for all queries into operations, Bintrail itself becomes an audit risk.

Pitfall 5: Halting PostgreSQL migration projects entirely

Deciding that "PostgreSQL migration is no longer needed since we can keep MySQL with Bintrail" overlooks other PostgreSQL-driven requirements (JSONB, full-text search, PostGIS). This decision should be evaluated solely based on audit requirements.

90-day action plan

WeekAction
Week 1〜2Comprehensive MySQL cluster inventory + audit requirements evaluation
Week 3〜4Binlog format unification + ProxySQL HA design
Week 5〜7Phased Bintrail rollout (validation → staging → production canary)
Week 8〜9Development of forensics SQL templates
Week 10〜11Training for client SRE and security teams
Week 12〜13Launching monthly review meetings + initial audit report delivery

Summary — Elevating MySQL to the centerpiece of your audit infrastructure

Bintrail marks a turning point that retrofits MySQL with time travel query capabilities comparable to PostgreSQL. From the perspective of supporting core enterprise databases at mid-sized companies, whether you can holistically assemble inventory, design, phased rollout, operational foundations, and monthly reviews determines the success or failure of your audit infrastructure.

If you want to "meet audit requirements while staying on MySQL," "cut incident investigation time by an order of magnitude," or "avoid migrating to PostgreSQL," we provide tailored estimates for DB forensics infrastructure based on your cluster configuration and audit requirements. Feel free to reach out via our contact form.

Sources

Share this articleXFacebook
Kakeru Suzuki

Fascinated by the possibilities of technology, has had a deep interest in programming and digital art since student days

Turn this article's theme into your company's next step

Concrete steps forward for your organization.

We organize your desired architecture, legacy systems, and operational requirements to formulate your next steps toward execution.

  • Desired architecture
  • Integration with existing environments
  • Operational requirements
Consult on development & operations initiatives

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email