v.20.8Experimental Feature

ClickHouse Supports MySQL Replication via MaterializeMySQL Engine

ClickHouse can work as MySQL replica - it is implemented by MaterializeMySQL database engine. Implements #4006. #10851 (Winter Zhang).
Introduces the MaterializeMySQL database engine that allows ClickHouse to operate as a MySQL replica.

Why it matters

The feature enables users to replicate data from MySQL into ClickHouse, providing real-time materialized views of MySQL databases. This allows analytic queries in ClickHouse on MySQL data without impacting the performance of the MySQL server.

How to use it

To enable MySQL replication, create a database in ClickHouse using the MaterializeMySQL engine by specifying MySQL connection parameters. For example:

CREATE DATABASE mysql_replica ENGINE = MaterializeMySQL('mysql_host', 'mysql_db', 'user', 'password');

This will start replication and materialization of MySQL tables within the specified ClickHouse database.