explaingit

alibaba/canal

29,699JavaAudience · developerComplexity · 4/5ActiveLicenseSetup · hard

TLDR

Reads MySQL database changes in real time and streams them to other systems without modifying your application code.

Mindmap

mindmap
  root((Canal))
    What it does
      Reads MySQL binary log
      Streams changes real-time
      Acts as MySQL replica
    Use cases
      Sync database mirrors
      Build search indexes
      Refresh caches
      Feed message queues
    Tech stack
      Java backend
      MySQL 5.1-8.0
      Web admin UI
    Client support
      Java, Go, Python
      PHP, C#, Rust, Node.js
    Key benefit
      No app code changes
      Reliable delivery
      Real-time pipeline

Things people build with this

USE CASE 1

Keep a read-only database replica synchronized with your primary MySQL database in real time.

USE CASE 2

Build and maintain real-time search indexes by capturing every insert, update, and delete from MySQL.

USE CASE 3

Invalidate or refresh cached data whenever rows change in your database without polling.

USE CASE 4

Stream database changes into Kafka or other message queues for downstream microservices to consume.

Tech stack

JavaMySQLKafkaGoPythonNode.js

Getting it running

Difficulty · hard Time to first run · 1day+

Requires MySQL, Kafka, and Java runtime; multiple services must be running and configured together.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice and disclose source code modifications.

In plain English

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.

Copy-paste prompts

Prompt 1
How do I set up Canal to capture MySQL changes and send them to Kafka? Walk me through the configuration.
Prompt 2
I need to keep an Elasticsearch index in sync with my MySQL database. How would I use Canal to do this?
Prompt 3
Show me how to write a Canal client in Go that consumes database change events and updates a cache.
Prompt 4
What's the difference between Canal and using MySQL triggers or application-level change tracking?
Prompt 5
How do I deploy Canal with the web admin interface and monitor multiple MySQL instances?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.