This topic describes the Multi-master Cluster.

With the growth of PolarDB for MySQL customers, especially tier-1 customers, the PolarDB for MySQL architecture that consists of one primary node and multiple read-only nodes cannot provide sufficient write performance that is necessary for the large-scale customer business.

Therefore, PolarDB for MySQL provides the multi-master architecture that contains multiple primary nodes and read-only nodes. The new architecture is suitable for high concurrent read and write scenarios such as multitenancy, gaming, and e-commerce.

The following figure shows the multi-master architecture.Multi-master architecture

All data files in a cluster are stored in PolarStore. Each primary node uses PolarFile System to share data files. You can access all nodes in a cluster by using the cluster endpoint. The database proxy automatically forwards SQL statements to the required primary node.

Core advantages

  • Concurrent data writes to databases on different nodes are supported.
  • Cluster supports one primary node and a maximum of 15 read-only nodes. Multi-master Cluster supports concurrent data writes to databases from a maximum of 32 primary nodes.
  • Dynamic failover of nodes for databases can be implemented within seconds to improve the overall concurrent read and write capabilities of clusters.

Scenarios

The multi-master architecture is suitable for scenarios such as multitenancy in software as a service (SaaS), gaming, and e-commerce. These scenarios feature high concurrent read and write requests.
  • Multitenancy in SaaS: high concurrency and load balance between tenants

    Scenario: The number of databases of tenants rapidly changes, and the load volume undergoes substantial changes. Users must schedule database resources among different instances to deliver optimal experience.

    Solution: The multi-master architecture helps customers to switch between different read-only nodes of databases of tenants. This implements load balance.

  • Gaming applications deployed on different servers: better performance and scalability and global servers supported

    Scenario: During the growth period of a game, database loads are heavy and feature continual increase. During this period, the number of databases keeps growing. As a result, the loads of primary nodes also increase. During the decline period of a game, database loads are significantly reduced, and databases are merged. As a result, the loads of primary nodes are also decreased.

    Solution: During the growth period, you can switch some databases to new primary nodes to implement load balance. During the decline period, you can aggregate databases to a few primary nodes to reduce operating costs.

Performance improvement

After tests, the overall concurrent read and write capabilities of a cluster show a linear increase because the databases of the cluster are switched to more primary nodes. The following code snippet provides an example of stress testing:
  • Test background: The cluster contains eight databases and eight primary nodes.
  • Test procedure: At the beginning of a test, eight databases share one primary node. Data is synchronized to all databases at the same time to perform the same stress test. During the stress testing period, eight databases are scheduled to two primary nodes, four primary nodes, and eight primary nodes respectively. View the change trend of the overall performance of the cluster.
  • The following figure shows the change trend of QPS.Performance improvement

In the preceding figure, as databases are scheduled to more primary nodes, the overall concurrent read and write capabilities of the cluster are significantly improved and show a linear increase.

Supported kernel versions

Only PolarDB for MySQL 8.0 supports Multi-master Cluster Edition.

Node specifications and pricing

Multi-master Cluster supports seven node types of Dedicated clusters. For more information, see Specifications of compute nodes.

For more information about the billing of Multi-master Cluster, see Billable items.

Usage

The feature is still in the canary release stage. You can submit a ticket to apply for the feature. For more information, see Usage.
Note Only the canary release version of the Multi-master Cluster Edition feature is available for enterprise users.