A key goal of designing PolarDB-X was to make the service compatible with the MySQL ecosystem. This topic describes the compatibility between PolarDB-X and MySQL in terms of SQL syntax, transaction behavior, and data import and export.

MySQL protocol

PolarDB-X is compatible with the MySQL protocol. PolarDB-X clusters can communicate with common MySQL clients by using drivers such as JDBC drivers, ODBC drivers, and Golang drivers. PolarDB-X can be connected to MySQL clients by using protocols such as SSL, the prepared statement protocol, and Load.

Compatibility with SQL statements

PolarDB-X is compatible with DML, Data Access Language (DAL), and DDL commands in MySQL.
  • The service is compatible with most MySQL functions, including JSON functions, encryption functions, and decryption functions.
  • The service is compatible with views, common table expressions (CTEs), window functions, and analytic functions in MySQL 8.0.
  • The service supports all data types, including TIMESTAMP and DECIMAL.
  • The service is compatible with common strings, character sets and collations in MySQL.
  • The service is compatible with most information_schema views.

For more information, see Developer Guide.

Atomicity, consistency, isolation, durability (ACID) transactions

Transactions in PolarDB-X are designed based on ReadView and pessimistic locking. The transactions support the four isolation levels defined by the ANSI/ISO SQL-92 specifications. The transaction behavior in PolarDB-X is the same as that in MySQL. By default, the Repeatable Read isolation level is used by transactions in PolarDB-X. This is the same in MySQL. When this isolation level is used, gap locking occurs if a range condition in a statement is updated.

PolarDB-X supports multiversion concurrency control (MVCC) based on a rollback segment. This feature is suitable for large transactions, such as transactions that require several hours to complete and transactions in which data of multiple gigabytes is written.

Accounts and permissions

The method to manage accounts and permissions in PolarDB-X is the same as that in MySQL. PolarDB-X supports statements such as GRANT, REVOKE, SHOW GRANTS, CREATE USER, DROP USER, and SET PASSWORD. You can grant database-level and table-level permissions. You cannot grant column-level permissions. For more information, see Manage accounts and permissions.

PolarDB-X also supports role-based access control. A role is a collection of permissions that you can assign to specific users. A role defines the data that a user can view and the actions that the user is allowed to perform in an application. The operations that each role can perform in PolarDB-X are the same as the operations that the same role can perform in MySQL.

Data backup and security

PolarDB-X is compatible with the regular backup policies in MySQL. In most cases, data is backed up on nodes other than the primary node. This ensures that the backup operation does not affect business traffic. PolarDB-X supports scheduled full backups and real-time incremental backups of binary logs. PolarDB-X supports consistent restoration to a specified point in time.

PolarDB-X is compatible with transparent data encryption (TDE) in MySQL. You can encrypt the files in tablespaces to ensure the security of business data.

Data import and export

PolarDB-X is compatible with the protocol used in MySQL replication based on binary logs. You can use a PolarDB-X cluster as a regular MySQL database and use another MySQL database as the source or destination for data synchronization to or from the PolarDB-X cluster.

The binary log format in PolarDB-X is the same as that in MySQL. Therefore, you can use PolarDB-X in scenarios where change data capture (CDC) is used to synchronize data. For example, you can use Canal to synchronize the data that is written to PolarDB-X to other storage.

Alibaba Cloud database services

Alibaba Cloud provides various data-related services. PolarDB-X can connect to other Alibaba Cloud services. PolarDB-X is highly compatible with cloud native ecosystems. This helps you use PolarDB-X in diverse business scenarios. PolarDB-X is compatible with Alibaba Cloud database services, such as Data Management (DMS), Data Transmission Service (DTS), Database Backup (DBS), Database Autonomy Service (DAS), and DataWorks.

  • Use PolarDB-X together with DTS

    Data Transmission Service (DTS) is a data transmission service that provides diverse features. You can use DTS to migrate data, subscribe to data, and synchronize data in real time. PolarDB-X is deeply integrated into DTS to support various transmission channels. This way, you can import data from databases of common types to PolarDB-X instances or export data from PolarDB-X instances to databases of common types.

  • Use PolarDB-X together with DMS

    Data Management (DMS) is a data management service that provides multiple features. You can use DMS to perform operations on PolarDB-X instances. For example, you can manage data and database schemas. You can also grant users specific permissions on the PolarDB-X instances. For more information, see DMS official documentation.

  • Use PolarDB-X together with DAS

    Database Autonomy Service (DAS) is a cloud service that uses machine learning and the experience of database experts to automate perception, self-repair, optimization, O&M, and security for databases. PolarDB-X can connect to DAS to provide performance trends, index recommendation, storage analysis, throttling of SQL queries, real-time performance analysis, deadlock analysis, and SQL Explorer. For more information, see DAS official documentation.

  • Use PolarDB-X together with CloudMonitor

    CloudMonitor is a service that provides the cloud resource monitoring and alerting feature. You can connect PolarDB-X instances to CloudMonitor. CloudMonitor provides the monitoring and alerting feature for computing resources and storage resources of the PolarDB-X instances. For more information, see Monitoring and alerting.