1v0.2.1

Live Replication Streaming

Connect Binsight as a read-only replication client to stream binlog events over MySQL protocol.

In addition to reading static files on disk, Binsight can connect directly to an active MySQL 5.7, MySQL 8.0/8.4, or MariaDB 10.6+ cluster and tail changes in real-time as a read-only replica.

How Streaming Mode Works

Binsight connects to the MySQL network socket (port 3306), completes the replica handshake, and issues the standard COM_BINLOG_DUMP (or COM_BINLOG_DUMP_GTID) command. As the database primary writes transactions, it pushes binary log packets directly to Binsight:

  • Binsight decodes replication packets in memory without writing files to production storage.
  • Events are pushed into the web UI over an HTTP Server-Sent Events (SSE) channel.
  • The web interface displays a pulsing green LIVE indicator with real-time TPS and mutation rates.

Enabling Live Replication

Configure streaming mode using CLI flags or environment variables:

Terminal
binsight serve \ --stream.enabled=true \ --stream.host=10.0.1.25 \ --stream.port=3306 \ --stream.user=binsight_reader \ --stream.password=SecretPass123 \ --stream.flavor=mysql

Required MySQL User Privileges

To connect as a replication client, the database user requires only read-only replication privileges. No table read or write privileges are needed:

MySQL Shell
CREATE USER 'binsight_reader'@'%' IDENTIFIED BY 'SecretPass123'; GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'binsight_reader'@'%'; FLUSH PRIVILEGES;

In-Memory Ring Buffer & Spooling

To protect the host machine from running out of RAM during sudden high-throughput database bursts, Binsight implements a bounded in-memory spooler governed by:

Terminal
--stream.max-spool-bytes=536870912 # Defaults to 512 MB

When the buffer reaches capacity, oldest read events are flushed to temporary local scratch files and automatically pruned when the session ends.

ESC
Quick Commands
Navigation
↑ ↓ navigate↵ select