The OceanBase Binlog service collects transaction logs from OceanBase and converts them into MySQL-compatible binary logs. It supports real-time data subscription and similar scenarios.
Background information
MySQL binary logging serves as the foundation for master-replica replication and change tracking. You can enable it with minimal performance overhead. The OceanBase Binlog service lets you reuse existing MySQL binary log parsing systems to sync incremental data from OceanBase databases running in MySQL-compatible mode, without requiring custom development or a new environment setup. You can seamlessly migrate your existing MySQL-based incremental data subscription solution to ApsaraDB OceanBase.
Performance limits
The performance of the Binlog conversion service depends on resource allocation and clog parsing capacity. Currently, the maximum clog parsing rate is 25 MB/s, and the maximum Binlog conversion rate is approximately 50,000 records per second (RPS). If your source service traffic exceeds these limits, Binlog conversion latency may increase. The Binlog service supports up to 50 concurrent subscription connections and rejects new subscription requests once this limit is reached. In high-traffic or large-transaction scenarios, the Binlog service processes clogs gradually to ensure end-to-end real-time delivery.
Under normal load, Binlog conversion latency remains under 1 second. However, during frequent data definition language (DDL) operations or large transactions, sub-second latency is not guaranteed.
Binlog service features
If no subscription connection is active for more than 7 days, the Binlog service shuts down automatically.
The OceanBase Binlog service manages Binlog at the tenant level. You cannot enable Binlog for individual databases or tables.
The OceanBase Binlog service uses the MySQL binary log Row format and records changes at the row level.
OceanBase databases in MySQL-compatible mode support most MySQL data types. For details, see OceanBase MySQL data types overview. Because the DDL syntax in OceanBase MySQL-compatible mode differs slightly from standard MySQL — for example, by including proprietary extensions — some DDL statements may fail to parse.
NoteOceanBase MySQL-compatible mode tenants do not support extended semantics for ENUM and SET types. Examples include SET definitions with more than 64 values, duplicate values in SET, and inserting undefined values (such as '') into ENUM columns.
VARCHAR columns support up to 65,535 bytes. If a VARCHAR column exceeds this limit, table data parsing may fail.
Note: Character set configuration affects the maximum VARCHAR length. For example, with utf8mb4, each character uses 4 bytes, so the maximum VARCHAR length is 16,383.
OceanBase MySQL-compatible mode tenants support up to 48 MB for LONGBLOB and LONGTEXT columns, which differs from MySQL.
If your OceanBase database version is V4.x, configure generated columns with the STORED attribute. Otherwise, Binlog does not convert generated column data, which may cause downstream subscription parsing failures or data loss.
The Binlog protocol in OceanBase MySQL-compatible mode closely matches MySQL 5.7. Its core features are nearly identical to MySQL binary logging. Specifically:
It supports both filename + offset and GTID modes. OceanBase Binlog generates globally unique GTIDs.
It supports reading binary logs for all databases and all tables. The OceanBase Binlog service dumps all incremental data across all databases and tables in a tenant and stores it persistently as binary logs.
It supports multiple Binlog dump subscriptions. Each subscription can specify any offset within the range from the earliest to the latest binary log position.
It supports automatic Binlog cleanup. After you enable the OceanBase Binlog service on Alibaba Cloud, logs are retained for 18 hours or up to 50 GB, whichever condition is met first.
It works with mainstream MySQL binary log parsing tools such as FlinkCDC, canal, and Maxwell.
The Binlog service is highly available and recovers automatically within minutes after a failure. However, downstream subscribers must implement reconnection logic to avoid disconnection and failed auto-recovery during outages.
How to get Binlog
Connection method: Connect using the tenant primary endpoint.
Version requirement: The OceanBase database instance must be version V3.2.4 or later.
Procedure:
The OceanBase Binlog service is disabled by default. Enable it first. For details, see Enable the Binlog service.
Connect to the OceanBase database using a MySQL client. For steps, see Connect to OceanBase using a MySQL client.
After connecting to OceanBase, run MySQL binary log commands in the connected client.
Run the
show binary logsstatement to list binary log files.
Run the
show master statusstatement to view the current binary log file being written to.
Run the
show binlog eventsstatement to view event details in a binary log file.
Subscribe using canal. For steps, see QuickStart.