canal
阿里巴巴 MySQL binlog 增量订阅&消费组件
Canal is a tool that reads MySQL's binary log (a running record that MySQL keeps of every change made to the database) and streams those changes to other systems in real time. It works by pretending to be a MySQL replica — a secondary copy that MySQL normally uses for backups and read scaling. MySQL then automatically sends Canal every insert, update, and delete event, which Canal parses and forwards to consumers.
This solves a common problem in large-scale software: when data changes in a MySQL database, other systems (caches, search indexes, data warehouses, microservices) need to know about those changes quickly. Canal provides that pipeline without requiring you to modify the application that writes to MySQL. Common uses include keeping a database mirror in sync, building real-time search indexes, refreshing caches when database rows change, and feeding data into message queues like Kafka for downstream processing.
Canal supports MySQL versions 5.1 through 8.0, and client libraries exist for Java, Go, Python, PHP, C#, Rust, and Node.js. It also includes a web-based admin interface for managing and monitoring Canal instances. Someone would use Canal when they need to react to database changes reliably and in real time without adding direct hooks into the application code.