Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Wire Format: Maxwell

The Maxwell wire format decodes messages produced by Maxwell's Daemon, a MySQL CDC tool. This allows pg_tide to ingest MySQL change streams into a PostgreSQL inbox — useful for migrating data from MySQL to PostgreSQL, building cross-database event pipelines, or consolidating changes from multiple MySQL instances.

Note: Maxwell is decode-only. pg_tide can consume Maxwell messages but does not produce them.

Message Shape

Maxwell produces JSON messages with this structure:

{
  "database": "myapp",
  "table": "users",
  "type": "insert",
  "ts": 1714029482,
  "xid": 12345,
  "data": {
    "id": 7,
    "name": "alice",
    "email": "alice@example.com"
  }
}

For UPDATE operations, an old field contains the previous values of changed columns:

{
  "database": "myapp",
  "table": "users",
  "type": "update",
  "ts": 1714029482,
  "xid": 12346,
  "data": {
    "id": 7,
    "name": "alice_new",
    "email": "alice@example.com"
  },
  "old": {
    "name": "alice"
  }
}

Decoded Fields

Inbox FieldMaxwell Source
event_idMessage key or generated UUID
event_type{database}.{table}
opFrom type: insert, update, delete
payloadFrom data field
old_payloadFrom old field (updates only)
commit_tsFrom ts (Unix seconds)
source_positionFrom xid or position

Configuration

[[pipelines]]
name = "mysql-to-postgres"
wire_format = "maxwell"

[pipelines.wire_config]
treat_bootstrap_as_insert = true

Configuration Reference

ParameterTypeDefaultDescription
treat_bootstrap_as_insertbooltrueMap bootstrap-insert events as INSERT operations

Bootstrap Events

Maxwell supports "bootstrapping" — bulk-loading existing table data. These events have type: "bootstrap-insert". With treat_bootstrap_as_insert: true (the default), they're treated as normal inserts, allowing you to perform initial data loads through the same pipeline.

Further Reading