All Products
Search
Document Center

ApsaraDB for OceanBase:Overview

Last Updated:Apr 22, 2024

OceanBase Binlog collects transaction logs of ApsaraDB for OceanBase and converts the logs into MySQL binlogs. This service applies to real-time data subscription scenarios.

Background information

MySQL binlogs are the basis for leader-follower replication and data subscription. You can enable the binlog service with low performance and consumption for scenarios such as real-time data subscription. You can reuse your existing MySQL binlog incremental parsing system to synchronize incremental data of ApsaraDB for OceanBase in MySQL mode without additional development work or building a new environment. You can seamlessly migrate your MySQL-based incremental data subscription solution to ApsaraDB for OceanBase.

Performance limitations

The performance of the Binlog transformation service depends on resource configuration and Clog parsing. Currently, Binlog handles Clog log parsing at a maximum of 25MB/s. The upper limit for Binlog's conversion rate per second (RPS) is around 50,000. If your traffic exceeds these limits your Binlog service latency may increase.

Under controlled business load, Binlog service latency usually stays below 1 second. However, in special cases such as frequent Data Definition Language (DDL) operations or large transactions, second-level conversion latency is not guaranteed.

Features

  • OceanBase Binlog can be enabled only for tenants but not for databases or tables.

  • OceanBase Binlog is compatible with the row-based format of MySQL Binlog. Binlogs are recorded based on data changes in each row.

  • ApsaraDB for OceanBase in MySQL mode is compatible with most MySQL data types. For more information, see Overview. The DDL syntax of ApsaraDB for OceanBase in MySQL mode differs from those in MySQL Database in the special extended syntaxes, which may not be parsed.

    Note
    • The extended semantics for the ENUM and SET types of ApsaraDB for OceanBase in MySQL mode are not supported. For example, ApsaraDB for OceanBase in MySQL mode supports more than 64 SET definitions, duplication, and insertion of undefined data (such as ") into an ENUM type column.

    • The VARCHAR(65536) type is not supported.

    • Geographic information system (GIS) types are not supported.

    • The maximum length of a LONGBLOB or LONGTEXT type column supported by ApsaraDB for OceanBase in MySQL mode is 48 MB, which is different from that in a MySQL database.

  • The Binlog protocol of ApsaraDB for OceanBase in MySQL mode is largely the same as that of MySQL 5.7. Therefore, it provides basic features that are almost the same as those of the MySQL Binlog protocol. The basic features are described as follows:

    • Supports binlog pull based on the filename and offset, or based on the global transaction ID (GTID). A GTID is a globally unique identifier generated by OceanBase Binlog.

    • Supports reading the binlogs of all tables in a database. OceanBase Binlog converts the incremental data of all database tables to binlogs for persistent storage by tenant.

    • Supports multiple binlog dump subscription links. You can subscribe to any checkpoints between the specified earliest and latest binlog checkpoints.

  • Supports periodic recycling of binlog files. By default, after you enable OceanBase Binlog in the ApsaraDB for OceanBase console, the system automatically deletes binlog files retained for more than 18 hours and the earliest binlog files when the storage space occupied by binlog files exceeds 50 GB.

  • Supports the connection between OceanBase Binlog and popular MySQL Binlog parsing tools, such as Flink CDC, Canal, and Maxwell.

Obtain binlogs

Connection method: connect by using the primary address of the tenant.

Database version: ApsaraDB for OceanBase V3.2.4 or later.

Procedure:

  1. Enable OceanBase Binlog. By default, this service is disabled. For more information, see Enable the binlog service.

  2. Connect to OceanBase Database from a MySQL client. For more information, see Connect to OceanBase Database by using a MySQL client.

  3. On the client, run commands related to MySQL binlogs.

    1. Execute the show binary logs statement to view the list of binlog files. show binary logs..png

    2. Execute the show master status statement to view the binlog file that is being written.show master status..png

    3. Execute the show binlog events statement to view information about specific events in the binlog file.show binlog events..png

  4. Subscribe to binlogs by using Canal. For more information, see Quick Start.