Compatibility with the MySQL ecosystem
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.
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.
PolarDB-X is compatible with MySQL ecosystem tools, such as Canal , MySQL Client etc.