Benefits

  • PolarDB-X is compatible with the format of MySQL binary log files and the command-line utility mysqldump protocol. Global binary logs in PolarDB-X are generated based on physical binary logs stored on data nodes. The distributed transaction feature is disabled for global binary logs. Only the non-distributed transaction feature is enabled for global binary logs. Global binary logs are compatible with the format of MySQL binary log files. The data subscription method of PolarDB-X is also fully compatible with the mysqldump protocol of MySQL. You can subscribe to transaction logs of PolarDB-X in the same manner as you subscribe to transaction logs of standalone MySQL databases.
  • The replication feature ensures the integrity and order of distributed transactions. When you use the global binary log feature, physical binary logs are not summarized in a simple manner. The Gather module and the MergeSort module of the feature ensure the integrity and order of distributed transactions. This ensures high data consistency. For example, in transaction scenarios, you can query the account balances that are consistent between tables from a MySQL instance of PolarDB-X at a point in time.
  • The replication feature provides the 24/7 service capability. You can perform simple O&M operations on the feature. The technology details of PolarDB-X are removed from the global binary log feature. You can use PolarDB-X as standalone MySQL databases. This ensures that instance modifications do not take effect on data subscription links. In PolarDB-X, a series of protocols and algorithms are used to implement the capability of global binary logs. This ensures that instance modifications do not take effect on data subscription links. For example, if you perform a high availability (HA) failover, add nodes, delete nodes, scale out a PolarDB-X instance, or execute distributed DDL statements, data subscription links are not affected.

Limits

  • If global transaction identifiers (GTIDs) are enabled for your PolarDB-X instance, you cannot subscribe to data.
  • You can merge distributed transactions only when the transaction policy is set to Timestamp Oracle (TSO). TSO helps ensure strong consistency.

SQL statements supported by the source instance for data subscription

  • Query the global binary log files of an PolarDB-X instance.
    SHOW BINARY LOGS
    Note To execute the preceding SQL statement, your account must be granted the SUPER permission or the REPLICATION CLIENT permission. For more information about permissions, see Manage accounts and permissions.
  • Query the binary log files of the primary node in a PolarDB-X instance.
    SHOW MASTER STATUS
    Note To execute the preceding SQL statement, your account must be granted the SUPER permission or the REPLICATION CLIENT permission. For more information about permissions, see Manage accounts and permissions.
  • Query the events included in global binary log files
    SHOW BINLOG EVENTS
       [IN 'log_name']
       [FROM pos]
       [LIMIT [offset,] row_count]
    Note To execute the preceding SQL statement, your account must be granted the SUPER permission or the REPLICATION CLIENT permission. For more information about permissions, see Manage accounts and permissions.

SQL statements supported by the destination instance for data subscription

If the destination instance is the instance of the native MySQL, the replication statements of MySQL are supported.

  • On the destination instance, specify the information about the source instance to which you want to subscribe.
    CHANGE MASTER TO option [, option] ... [ channel_option ]
    
    option: {
        MASTER_BIND = 'interface_name'
      | MASTER_HOST = 'host_name'
      | MASTER_USER = 'user_name'
      | MASTER_PASSWORD = 'password'
      | MASTER_PORT = port_num
      | PRIVILEGE_CHECKS_USER = {'account' | NULL}
      | REQUIRE_ROW_FORMAT = {0|1}
      | REQUIRE_TABLE_PRIMARY_KEY_CHECK = {STREAM | ON | OFF}
      | ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS = {OFF | LOCAL | uuid}
      | MASTER_LOG_FILE = 'source_log_name'
      | MASTER_LOG_POS = source_log_pos
      | MASTER_AUTO_POSITION = {0|1}
      | RELAY_LOG_FILE = 'relay_log_name'
      | RELAY_LOG_POS = relay_log_pos
      | MASTER_HEARTBEAT_PERIOD = interval
      | MASTER_CONNECT_RETRY = interval
      | MASTER_RETRY_COUNT = count
      | SOURCE_CONNECTION_AUTO_FAILOVER = {0|1}
      | MASTER_DELAY = interval
      | MASTER_COMPRESSION_ALGORITHMS = 'value'
      | MASTER_ZSTD_COMPRESSION_LEVEL = level
      | MASTER_SSL = {0|1}
      | MASTER_SSL_CA = 'ca_file_name'
      | MASTER_SSL_CAPATH = 'ca_directory_name'
      | MASTER_SSL_CERT = 'cert_file_name'
      | MASTER_SSL_CRL = 'crl_file_name'
      | MASTER_SSL_CRLPATH = 'crl_directory_name'
      | MASTER_SSL_KEY = 'key_file_name'
      | MASTER_SSL_CIPHER = 'cipher_list'
      | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}
      | MASTER_TLS_VERSION = 'protocol_list'
      | MASTER_TLS_CIPHERSUITES = 'ciphersuite_list'
      | MASTER_PUBLIC_KEY_PATH = 'key_file_name'
      | GET_MASTER_PUBLIC_KEY = {0|1}
      | NETWORK_NAMESPACE = 'namespace'
      | IGNORE_SERVER_IDS = (server_id_list)
    }
    
    channel_option:
        FOR CHANNEL channel
    
    server_id_list:
        [server_id [, server_id] ... ]
  • Start the replication task to replicate data from the primary node to read-only nodes.
    START {SLAVE | REPLICA}
  • Stop the replication task to replicate data from the primary node to read-only nodes.
    STOP {SLAVE | REPLICA}
  • Before you reconfigure the replication task, stop the replication task.
    RESET {SLAVE | REPLICA} [ALL] [channel_option]
    
    channel_option:
        FOR CHANNEL channel
    Note If the destination instance is PolarDB-X, the replication statements are not supported.