Scripts2026年7月2日·1 分钟阅读

Maxwell — MySQL Binlog Change Data Capture Daemon

Maxwell reads MySQL binlogs and writes row-level data changes as JSON to Kafka, Kinesis, RabbitMQ, or other streaming platforms for real-time change data capture.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Maxwell Overview
直接安装命令
npx -y tokrepo@latest install bf07a759-75f0-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Maxwell is a CDC (Change Data Capture) application that reads MySQL binary logs and outputs row-level data changes as JSON documents. It provides a lightweight alternative to more complex CDC setups for streaming database changes to downstream consumers.

What Maxwell Does

  • Reads MySQL binary logs and emits row-level INSERT, UPDATE, and DELETE events as JSON
  • Outputs to Kafka, Amazon Kinesis, Google Pub/Sub, RabbitMQ, Redis, or stdout
  • Tracks its own binlog position in a MySQL schema for crash recovery
  • Supports initial bootstrapping to capture the full current state of a table
  • Handles DDL changes and schema evolution automatically

Architecture Overview

Maxwell connects to a MySQL server as a replication client, reading binary log events in real time. It maintains an internal representation of the database schema by tracking DDL statements. Each row-level change is transformed into a self-contained JSON document that includes the database, table, type of change, and the affected column values. Binlog position is persisted in a dedicated Maxwell schema within MySQL itself, enabling exactly-once delivery semantics with idempotent consumers.

Self-Hosting & Configuration

  • Requires MySQL with binlog_format=ROW and binlog_row_image=FULL
  • Create a Maxwell-specific MySQL user with replication and schema privileges
  • Run via Docker or as a standalone Java application with a config.properties file
  • Configure the output producer (Kafka, Kinesis, etc.) and topic routing
  • Use the bootstrapping feature to capture the initial state of existing tables

Key Features

  • Lightweight single-process daemon with minimal resource requirements
  • JSON output format is easy to parse and integrate with downstream systems
  • Schema-aware: includes column names and types in change events
  • Supports filtering by database, table, or column to reduce event volume
  • Built-in bootstrapping for initial data loads without stopping writes

Comparison with Similar Tools

  • Debezium — JVM-based with broader database support; Maxwell is MySQL-specific and simpler to operate
  • Canal — Alibaba CDC tool; Maxwell outputs standard JSON and supports more producers
  • MySQL Streamer — Yelp tool; Maxwell is actively maintained with broader community support
  • AWS DMS — managed service with vendor lock-in; Maxwell is open-source and self-hosted
  • Tungsten Replicator — complex clustering tool; Maxwell focuses on CDC-to-streaming simplicity

FAQ

Q: Which MySQL versions does Maxwell support? A: Maxwell supports MySQL 5.1 through 8.x and MariaDB. It requires row-based binary logging to be enabled.

Q: How does Maxwell handle schema changes? A: Maxwell tracks DDL statements in the binary log and updates its internal schema representation. Schema changes are emitted as separate events.

Q: Can Maxwell replay historical changes? A: Maxwell can rewind to any saved binlog position. The bootstrap feature can also re-emit the current state of a table as INSERT events.

Q: What happens if Maxwell crashes? A: Maxwell stores its binlog position in MySQL. On restart, it resumes from the last committed position, ensuring no events are skipped.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产