A key goal of designing PolarDB-X is 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.

Compatibility with MySQL protocol

PolarDB-X is compatible with the MySQL protocol. You can connect to PolarDB-X instances by using common drivers, such as JDBC drivers, ODBC drivers, and Golang drivers. PolarDB-X is also compatible with transfer protocols such as MySQL SSL, Prepare, and Load protocols.

SQL compatibility

PolarDB-X is compatible with the DML, DAL, and DDL syntaxes of MySQL, including the following items:
  • Most MySQL functions, including JSON, encryption, and decryption functions
  • Views, common table expressions (CTEs), window functions, and analytic functions in MySQL 8.0
  • All data types in MySQL, including TIMESTAMP and DECIMAL
  • Common strings, character sets, and collations in MySQL
  • 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 specifications and have the same behaviors as in MySQL. By default, transactions in PolarDB-X use the Repeatable Read isolation level. This is the same in MySQL. In this case, gap locking occurs if a range condition in a statement is updated.

PolarDB-X supports multiversion concurrency control (MVCC) that is based on rollback segments. This feature is suitable for large transactions, such as those that consume hours and those in which gigabytes of data are written.

Accounts and permissions

In PolarDB-X, accounts and permissions are managed in the same way as in MySQL. Statements such as GRANT, REVOKE, SHOW GRANTS, CREATE USER, DROP USER, and SET PASSWORD are supported. You can grant database-level and table-level permissions, but cannot grant column-level permissions. For more information, see 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 is accessible to a user 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-critical 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 table spaces to ensure the security of business data.

Data import and export

PolarDB-X is compatible with the protocol used for binary log-based replication in MySQL. You can use a PolarDB-X instance as a regular MySQL database and synchronize data between the PolarDB-X instance and another MySQL database.

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 another storage system.

Database tools

Alibaba Cloud provides a wide range of data-related products and services. PolarDB-X can connect to other cloud services and is highly compatible with cloud native ecosystems. This makes it applicable to 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.

  • Integration with DTS

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

  • Integration 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, and grant users permissions. For more information, see DMS documentation.

  • Integration with DAS

    Database Autonomy Service (DAS) is a cloud service that automates perception, repair, optimization, O&M, and security management for databases based on machine learning and the experience of database experts. 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 documentation.

  • Integration with CloudMonitor

    CloudMonitor is a service that allows you to monitor cloud resources and configure alert rules. You can connect PolarDB-X instances to CloudMonitor, which monitors computing resources and storage resources of PolarDB-X instances and issues alerts for the resources that trigger the configured alert rules. For more information, see Monitoring computing resources.