Data subscription uses Change Data Capture (CDC) to continuously read database logs from upstream sources (such as MySQL Binlog or OceanBase Binlog services). After parsing, sorting, or transforming the incremental changes, it replays them at the target side. Common targets include OceanBase, Kafka, and then writes the data to analytics databases or wide tables via Flink/custom consumers.
Typical scenarios: Real-time synchronization to BI/data warehouses, cache and search engine refresh, incremental data catch-up during migration and cutover, traffic throttling via Kafka for multi-team consumption, and data export from OceanBase Binlog.
Subscribe to MySQL Binlog using Canal
Canal simulates a MySQL Slave node to subscribe to Binlog and delivers row-level changes to the client. It can be configured to directly synchronize data to OceanBase, or first write data to a message system via modes such as TCP / Kafka / RocketMQ / RabbitMQ, and then be consumed by downstream components and written to the target database (including OceanBase).
Scenario |
Description |
Documentation |
|---|---|---|
| MySQL → OceanBase(Canal) | Incremental data is written to OceanBase Database based on MySQL binlog parsing. | Use Canal to synchronize data from a MySQL database to OceanBase Database |
| OceanBase → MySQL(Canal) | The source requires the OceanBase Binlog Service to provide logs in a MySQL Binlog-compatible format for subscription. | Use Canal to synchronize data from OceanBase Database to a MySQL database |
| MySQL → OceanBase(CloudCanal) | The Community Edition of the pipeline, also a Binlog-based synchronization solution, can be used for comparison and selection with Canal. | Use CloudCanal to migrate data from a MySQL database to OceanBase Database |
Subscribe to multiple-source databases using Flink CDC
Flink CDC provides a Database CDC Source on top of Flink, which can pull stock + incremental data from various databases. Combined with Flink SQL, it performs joins, widening, and aggregation, then writes the data to sinks such as Kafka, JDBC (including OceanBase), and Hive. It is suitable for pipelines requiring multi-source integration, real-time processing, and high Exactly-Once compliance.
Scenario |
Description |
Documentation |
|---|---|---|
| MySQL → OceanBase | MySQL CDC Source, for incremental synchronization to OceanBase. | Use Flink CDC to synchronize data from a MySQL database to OceanBase Database |
| OceanBase → MySQL | Depends on the OceanBase Binlog Service and creates an OceanBase CDC source table in Flink. | Use Flink CDC to migrate data from OceanBase Database to a MySQL database |
| OceanBase Incremental (ChunJun / FlinkX) | Based on the Binlog service andoblogclientThe incremental synchronization framework. |
Use ChunJun to migrate data from OceanBase Database to a MySQL database |
| StarRocks to OceanBase (Flink Job) | OceanBase provides a Flink migration tool, which is suitable for scenarios where the base tables in the SR processing pipeline are inconsistent. | Use Flink-OMT to synchronize data from a StarRocks database to OceanBase Database |
Data subscription and writing to Kafka / OceanBase scenarios
A common pattern is: Log parsing by CDC or Canal → Writing to Kafka (buffering, multiple subscriptions) → Flink/OMS/custom consumer → Persistence in OceanBase or other storage. Alternatively, Flink CDC can directly sink data to OceanBase JDBC, omitting Kafka, depending on throughput requirements and coupling considerations.
Scenario |
Description |
Document / Link |
|---|---|---|
| TiDB:TiCDC → Kafka → OMS → OceanBase | TiDB incremental data is delivered via Kafka and consumed by OMS to write into the OceanBase MySQL-compatible tenant (a new data source must be bound to Kafka). | Use OMS to migrate data from a TiDB database to an OceanBase Database tenant in MySQL-compatible mode |
| Connect OMS to Kafka/RocketMQ/DataHub | Supported downstream messaging and data integration formats on the product side, which can be combined with subscription links. | Data Migration Overview · Data Sources Supported by OMS (Migration Solution Support Table); OMS Documentation |
| Canal → Kafka (re-consume and write to OB) | Canal serverModeand other configurations tokafkaDuring synchronization, changes are first written to the topic and then consumed by OceanBase Database. |
Use Canal to synchronize data from a MySQL database to OceanBase Database |
| Flink CDC → Kafka → Downstream | Flink writes the CDC stream to Kafka for real-time data warehouse and multi-team consumption. For sink selection, refer to the Flink documentation. | Flink Kafka Connector |
| Write to OceanBase Database Directly by Using Flink or JDBC | Write directly to internal tables without using Kafka, via Flink JDBC or OceanBase connectors (note the semantics when used with import and direct load capabilities). | Flink JDBC SQL Connector; for more information about data import, see Overview |
