This topic describes how to enable the serverless feature on a read-only column store node.
Prerequisites
A PolarDB for MySQL 8.0 Enterprise Edition cluster that contains at least one read-only column store node is created.
Implementation methods
Specify a scaling range for a read-only column store node with defined specifications: You can enable the serverless feature on a read-only column store node with defined specifications. This way, temporary scale-ups can be performed when workloads exceed the capabilities of the defined specifications.
Create a serverless read-only column store node: A serverless read-only column store node does not have defined specifications and can be scaled based on workloads. This method is suitable for business scenarios that focus on cost efficiency.
Benefits
Effective cost reduction during business peak and off-peak hours
The serverless architecture of PolarDB can automatically downgrade the configurations of a cluster during off-peak hours and upgrade the configurations during peak hours to handle load fluctuations, which effectively reduces costs. Assume a scenario where 32 cores and 64 GB of memory are required during 12 peak hours, and 16 cores and 32 GB of memory are required during 12 off-peak hours to meet the performance requirements. Compared with the configurations of 32 cores and 64 GB of memory, the configurations of 16 cores and 32 GB of memory that use the serverless architecture reduce the costs of compute nodes by 25%.
Optimized serverless architecture
The In-Memory Column Index (IMCI) feature implemented on read-only nodes optimizes the elastic resource features of the serverless architecture, which further improves the performance and user experience.
Improved resource utilization: Read-only column store nodes provide a comprehensive resource management mechanism that allows you to configure multiple key system parameters such as cache, thread pool, and execution memory online. In the serverless architecture, the parameters are automatically modified when resources are scaled up or down to ensure optimal resource utilization.
Accelerated SQL queries: Read-only column store nodes are mainly used in analysis scenarios. To ensure that complex SQL queries run quickly, a large amount of resources are allocated to a single complex SQL query in most cases. An increase in the number of complex SQL queries can lead to resource contention. As a result, subsequent simple SQL queries in the queue are blocked by complex ones, resulting in slow SQL queries. In the serverless architecture, read-only column store nodes automatically allocate additional resources based on SQL queuing situations to alleviate the slow SQL issue caused by queuing.
NoteThis benefit is supported in the following engine versions:
PolarDB for MySQL 8.0.1 whose revision version is 8.0.1.1.39 or later.
PolarDB for MySQL 8.0.2 whose revision version is 8.0.2.2.20 or later.
Fast loading of IMCIs during startup: After a cluster is restarted, several minutes are required for read-only column store nodes to rebuild the internal index information. During this period, IMCIs are unavailable. In the serverless architecture, read-only column store nodes use elastic resources to accelerate the rebuilding process and allow IMCIs to quickly become available.
NoteThis benefit is supported in the following engine versions:
PolarDB for MySQL 8.0.1 whose revision version is 8.0.1.1.36 or later.
PolarDB for MySQL 8.0.2 whose revision version is 8.0.2.2.20 or later.
Accelerated log replay: IMCIs are created based on the replay of physical logs. However, the replay latency of IMCI logs may increase due to insufficient resources for creating IMCIs when the system allocates most resources for SQL queries. The replay latency may cause queries to be routed to other nodes or wait for the log replay to complete, resulting in slow SQL queries. In the serverless architecture, read-only column store nodes automatically allocate additional resources for log replay to improve log replay performance.
NoteThis benefit is supported in PolarDB for MySQL 8.0.1 whose revision version is 8.0.1.1.45 or later.
Accelerated DDL processing: An extended period of time is required to process DDL statements on IMCIs. In the serverless architecture, column store nodes adaptively increase thread resources to accelerate the processing of DDL statements.
NoteThis benefit is supported in the following engine versions:
PolarDB for MySQL 8.0.1 whose revision version is 8.0.1.1.44 or later.
PolarDB for MySQL 8.0.2 whose revision version is 8.0.2.2.25 or later.
Procedure
Specify a scaling range for a read-only column store node with defined specifications
Log on to the PolarDB console.
In the upper-left corner, select the region in which the cluster is deployed.
Find the cluster and click its ID.
In the Database Nodes section of the Basic Information page, click Enable Serverless.
In the Enable Serverless dialog box, configure the Maximum Resources for Single Node and Minimum Resources for Single Node parameters. For more information, see Enable the serverless feature for a cluster with defined specifications.
Click OK.
The serverless feature is enabled on the read-only column store node with defined specifications.
Create a serverless read-only column store node
In the left-side navigation pane, click Clusters.
In the upper-left corner, select the region in which the cluster is deployed.
Find the cluster and click its ID.
In the Database Nodes section of the Basic Information page, click Enable Serverless.
In the Enable Serverless dialog box, configure the Read-only Column Store Nodes parameter and click OK. In this example, one read-only column store node is created.
PolarDB automatically creates a read-only column store node whose resources range from 1 PolarDB Capacity Unit (PCU) to 32 PCUs.