dbtrail
Configuration

Stream Configuration

Configure persistent binlog reading and change indexing

A stream is a persistent process that connects to your MySQL server as a replication client, reads binary log events in real-time, and indexes row-level changes (INSERT, UPDATE, DELETE) into the change index.

How streams work

Each stream runs as a systemd service (bintrail-stream-{server_id}) on the agent EC2 instance. The stream process and all its parameters are features of the open-source bintrail CLI — see the bintrail repo for advanced options beyond what the SaaS API exposes. The systemd service provides:

  • Auto-restart on crashRestart=on-failure in the systemd unit
  • Log management — via journald (journalctl -u bintrail-stream-{id})
  • Process lifecycle — start, stop, status via systemctl

Checkpoint and resume

The stream stores its position in the binlog via a stream_state table — recording the current binlog file and position (or GTID set). On restart, it resumes from the saved checkpoint automatically.

Reset behavior

The --reset flag (which clears the checkpoint and forces re-reading from a start position) is not exposed through the SaaS API. Resetting stream state is a manual operation performed directly on the server.

Stream parameters

ParameterDefaultDescription
schemasallComma-separated list of schemas to monitor
tablesallComma-separated list of tables (e.g., mydb.orders)
batch_size1000Number of events to process per batch
checkpoint_interval10Seconds between checkpoint writes
ssl_modepreferredSSL mode for the MySQL connection

SSL options

ParameterDescription
ssl_modedisabled, preferred, required, verify-ca, verify-full
ssl_caPath to CA certificate
ssl_certPath to client certificate
ssl_keyPath to client private key

Monitoring stream status

Check the status of a stream via the dashboard or the API. See the Status API reference for endpoint details.

Filtering

You can scope streams to specific schemas and tables. This is useful when you only need to track changes in certain databases or tables, reducing index size and agent resource usage.

{
  "schemas": "production,staging",
  "tables": "production.orders,production.users"
}

If no filters are specified, the stream monitors all schemas and tables.

On this page