This topic describes the integrated centralized-distributed solution of PolarDB-X.
Background information
You can select a centralized or distributed database based on your business requirements. For most small and medium-sized enterprises (SMEs), a centralized database can meet routine business requirements. A centralized database provides a moderate scale of resources, is cost-effective, and is relatively easy to maintain and operate. A distributed database delivers high performance and can manage complex business scenarios in an efficient manner. A distributed database can meet requirements for high throughput, extensive storage capacity, minimal latency, easy scalability, and robust availability. However, distributed databases are more expensive and have higher technical barriers and O&M costs, which may make them less suitable for SMEs.
SMEs may experience occasional surges in business traffic. To address fluctuations, SMEs require a database system that can manage high concurrency and throughput and can scale as needed. As the business grows, an enterprise that uses a centralized database may require distributed scaling to meet increasing requirements.
To address the preceding requirements, PolarDB for Xscale (PolarDB-X) provides an integrated centralized-distributed solution that combines the availability and resiliency of distributed databases and the centralized control and management capabilities of centralized databases.
Key features and benefits
The data nodes (DNs) on an integrated centralized-distributed database instance are set up in a centralized manner and are fully compatible with standalone databases. As the business grows and an upgrade to a distributed system is required, the architecture can be seamlessly transitioned in place into a distributed model. During the upgrade, distributed components are seamlessly integrated with existing DNs. This way, you can benefit from the enhanced availability and scalability provided by a distributed architecture without the need to migrate data or modify applications.
The following section describes the core features and benefits of the PolarDB-X integrated centralized-distributed solution.
Instance editions
PolarDB-X instances are available in the following editions: Standard Edition (centralized) and Enterprise Edition (distributed).
Standard Edition in centralized mode
PolarDB-X Standard Edition is in centralized mode and provides services by using multiple replicas on distributed DNs. The Standard Edition supports a minimum specification of 2 cores and 4 GB of memory. For more information, see Instance types.
PolarDB-X Standard Edition uses the Paxos majority consensus replication protocol. Compared with the primary-secondary replication protocol of MySQL, Paxos ensures strong consistency between replicas and can help achieve a recovery point objective (RPO) of 0 and a recovery time objective (RTO) of less than 30 seconds. The capabilities can meet the stringent disaster recovery requirements in financial scenarios. For more information, see High availability overview. The Lizard distributed transaction engine also provides enhanced availability and a performance increase of 30% to 40%, compared to open source MySQL.
To purchase a PolarDB-X Standard Edition instance, set the Edition parameter to Standard Edition. For more information, see Create a PolarDB-X instance.
Enterprise Edition in distributed mode
PolarDB-X Enterprise Edition uses a distributed architecture that includes compute nodes (CNs), DNs, change data capture (CDC) nodes, column store nodes (COLUMNAR), and global meta services (GMSs). The following figure shows the Enterprise Edition architecture.
PolarDB-X Enterprise Edition is highly compatible with the MySQL ecosystem. It ensures strong consistency in distributed transactions and facilitates distributed parallel queries. The system can be scaled from a minimum of 1 node (centralized) to 1,024 nodes (distributed). The system can also handle tens of millions of queries per second (QPS) and manage data on a petabyte scale.
To purchase a PolarDB-X Enterprise Edition instance, set the Edition parameter to Enterprise Edition. For more information, see Create a PolarDB-X instance.
Upgrade an instance from Standard Edition to Enterprise Edition
As the business rapidly grows, PolarDB-X Standard Edition users may face the limits of a centralized database system. For example, the performance of queries for a table that grows excessively large decreases. The database may struggle under high-concurrency queries, which results in sustained high load conditions and extended periods of performance degradation. The database may lack the advanced analytics capabilities required to process large volumes of data. Attempts to mitigate the preceding challenges by scaling up the database have proven to be expensive and ineffective.
PolarDB-X allows you to upgrade the instance from Standard Edition to Enterprise Edition in place and use the distribution features and Hybrid Transactional/Analytical Processing (HTAP) capabilities to address the challenges associated with centralized databases. In addition to the advantages of a distributed system, the upgrade retains the experience and performance that users expect from traditional, standalone MySQL databases.
The preceding figure shows the seamless in-place upgrade process of a PolarDB-X instance from Standard Edition to Enterprise Edition. The upgrade has the following features:
The Standard Edition and the Enterprise Edition share the same DNs. The upgrade directly adds CNs, CDCs, and GMSs to the Standard Edition without the need to migrate data. The same dataset is written whether you perform a switchover or rollback, which eliminates the risk of data inconsistency.
Centralized tables can be converted in place into distributed single tables. You can benefit from the scalability provided by a distributed database system by using the online data definition language (DDL) feature of PolarDB-X.
After an upgrade from Standard Edition to Enterprise Edition, the connection endpoints remain unchanged. You do not need to modify applications. The upgrade process may result in a brief disconnection that lasts only for a few minutes.
The system is designed to be deeply compatible with the centralized MySQL ecosystem. This ensures a transparent distributed experience without the need to modify applications. For more information, see Compatibility with MySQL.
After an upgrade from Standard Edition to Enterprise Edition, new distribution features may introduce additional performance overhead. To address this issue, PolarDB-X uses the table group and partition group technologies to ensure that related data is organized in a centralized manner. This approach streamlines the execution of distributed transactions and the processing of complex queries. As a result, the performance in a distributed environment is optimized to closely resemble that of a centralized database system, particularly in single-partition scenarios in which all relevant data is collocated.
Storage resource pools and elasticity specifications
PolarDB-X introduces the concepts of storage resource pools and the LOCALITY attribute to help users scale a centralized database to a distributed database on demand.
Storage resource pools organize DNs into distinct, non-overlapping groups to ensure that each DN belongs to only one pool. You can add a DN to or remove a DN from a storage resource pool.
You can use the LOCALITY attribute to specify DNs for databases, tables, or partitions.
The following section describes how to use the storage resource pool and LOCALITY attribute features to help users seamlessly expand database capabilities to a distributed architecture:
Scenario 1: A multi-tenant Software as a Service (SaaS) system originally operates on a PolarDB-X centralized Standard Edition instance. After the instance is upgraded from Standard Edition to Enterprise Edition, the tenant data can be segregated into different storage resource pools. Within each pool, the table is retained in the single-table structure, as shown in Storage Resource Pool 1 in the preceding figure. This approach allows you to perform distributed scaling while maintaining data organization and simplicity.
Scenario 2: An e-commerce business originally runs on a PolarDB-X centralized Standard Edition instance. As the user base and transaction volume increase, business data can be distributed into multiple DNs in a resource pool, as shown in Storage Resource Pool 3 in the preceding figure. This approach enables the system to handle increased demands without compromising performance or speed.
The following figure shows how centralized data can be distributed on demand in a distributed architecture by using online DDL.
For a business that uses multiple single tables, maintain the tables in the single-table structure. Use online DDL to add nodes to a resource pool and evenly distribute the tables across multiple DNs within the pool.
For a business that uses a large table, use online DDL to transform the table into a distributed table whose partitions are distributed across the DNs in the resource pool. After nodes are added to the storage resource pool, the data of the distributed table is evenly distributed across the DNs.
For a business that uses a large table and multiple single tables, use online DDL to transform the large table into a distributed table whose partitions are distributed across the DNs in the resource pool. Maintain the single tables in the single-table structure and distribute the single tables to different resource pools. This approach allows for scalable and flexible distribution of tables across resources and enhances the system capacity for linear and incremental scalability as the business grows.
The requirements of DNs for resources are different based on the data distribution. PolarDB-X allows you to separately upgrade or downgrade a DN. This allows you to adjust the specifications in a flexible manner and improves overall resource usage.
For information about how to manage the specifications of storage resource pools and DNs, see Manage data nodes.