explaingit

alibaba/canal

Analysis updated 2026-06-20

29,682JavaAudience · ops devopsComplexity · 4/5LicenseSetup · hard

TLDR

Canal reads MySQL's change log in real time and streams every insert, update, and delete to other systems like caches, search indexes, or message queues, without any changes to the application writing to MySQL.

Mindmap

mindmap
  root((repo))
    What It Does
      Stream DB changes
      Real-time sync
      No app changes
    How It Works
      MySQL binlog
      Fake replica
      Parse events
    Outputs
      Kafka
      RocketMQ
      Client libraries
    Tech Stack
      Java
      MySQL
      ZooKeeper
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Keep a Redis cache automatically in sync with MySQL by streaming database changes through Canal

USE CASE 2

Build a real-time search index that updates whenever a database row changes, without modifying application code

USE CASE 3

Feed database change events into Kafka so downstream microservices can react to data changes immediately

USE CASE 4

Mirror a MySQL database to another system for analytics or backup by subscribing to its binlog stream

What is it built with?

JavaMySQLKafkaRocketMQZooKeeper

How does it compare?

alibaba/canalapolloconfig/apolloyuliskov/smarttube
Stars29,68229,76429,964
LanguageJavaJavaJava
Setup difficultyhardhardmoderate
Complexity4/54/52/5
Audienceops devopsops devopsgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

MySQL must have binlog enabled in ROW format, Kafka or RocketMQ required for downstream event delivery.

Free to use for any purpose including commercial use under the Apache 2.0 license.

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
Set up Canal server to subscribe to a MySQL 8.0 binlog and forward inserts and updates on the orders table to a Kafka topic.
Prompt 2
How do I configure MySQL to work with Canal, what binlog format and permissions does the Canal user need?
Prompt 3
Write a Java Canal client that listens for row-level changes and deletes the matching key from a Redis cache when a database row is updated or deleted.
Prompt 4
How do I deploy Canal with high availability using ZooKeeper so a Canal node failure does not cause missed events?

Frequently asked questions

What is canal?

Canal reads MySQL's change log in real time and streams every insert, update, and delete to other systems like caches, search indexes, or message queues, without any changes to the application writing to MySQL.

What language is canal written in?

Mainly Java. The stack also includes Java, MySQL, Kafka.

What license does canal use?

Free to use for any purpose including commercial use under the Apache 2.0 license.

How hard is canal to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is canal for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub alibaba on gitmyhub

Verify against the repo before relying on details.