The serverless feature provides dynamic scaling capabilities to PolarDB clusters. Each node in a cluster can be scaled up within seconds to handle sudden increases in workloads without affecting business operations. When workloads decrease, nodes can be scaled down to save costs.
With Serverless feature, you don't have to worry about the resource configuration of your database cluster when you create and use databases. The following section shows the changes in resource usage and specifications of a common cluster and a serverless cluster when your business fluctuates:
|
Features
The serverless feature supports real-time scaling of CPU, memory, storage, and network resources. It also allows you to isolate network resources and storage resources and supports the pay-as-you-go billing method for computing and storage resources. Serverless clusters can help you quickly and independently scale computing and storage resources to adapt to fluctuating workloads, reduce costs, and improve efficiency.
Item | Description |
Architecture |
|
Scaling method |
|
PolarDB Capacity Unit (PCU) | The serverless feature uses PCU as the unit of measurement for billing and resource elasticity on a per-second basis. One PCU is approximately equal to 1 CPU core and 2 GB of memory. The PCUs of a node is dynamically adjusted within the specified range based on the workloads. The minimum granularity for scaling is 0.5 PCUs. |
Architecture
Serverless cluster | Serverless cluster with defined specifications |
Note
|
Note
|
Scaling
Trigger conditions for scale-up and scale-out
Scale-up
PolarDB monitors the CPU utilization, memory usage, and other kernel metrics of the primary node and read-only nodes. During a monitoring cycle, the scale-up of serverless resources is triggered for a node when one of the following events occur:
The CPU utilization of a single node is higher than the default scale-up threshold 80%.
The memory usage of a single node is higher than 90%.
The specifications of a read-only node are less than half of the specifications of the primary node. For example, if the specifications of a read-only node are 4 PCUs and the specifications of the primary node are 10 PCUs, the specifications of the read-only node are scaled up to at least 5 PCUs.
Scale-out
When a read-only node of a cluster is scaled up to the maximum specifications and the scale-up threshold is still reached (for example, CPU utilization is higher than the default threshold 80% or the specified threshold), the scale-out of read-only nodes is triggered.
Trigger conditions for scale-down
When the CPU utilization of a single node is lower than the default scale-down threshold 50% or a custom threshold and the memory usage is lower than 80%, the scale-down of the node is triggered.
The scaling range is determined by the maximum and minimum numbers of read-only nodes and the maximum and minimum PCUs per Node that you specify. For more information, see Set a scaling policy for serverless cluster resources or Set a scaling policy for serverless resources.
The metrics for triggering scaling vary based on cluster parameter configurations and serverless configurations. You can specify thresholds for CPU scaling, but cannot change thresholds for other metrics.
When the workloads of a serverless cluster suddenly increase, the nodes of the cluster are scaled step by step to approach the expected specifications, instead of one step at a time. The minimum step size for node scaling is 0.5 PCUs. To quickly adapt to the current workloads, the next scaling step size increases based on the current number of PCUs per node.
You can configure alert rules in Performance Monitoring of the PolarDB console to get notifications when scale-down is triggered for cluster nodes. For more information, see Create an alert rule.
Benefits
The serverless feature can dynamically scale cluster resources in seconds based on workloads. The serverless feature provides the following benefits:
High availability
The multi-node architecture ensures the high availability of serverless clusters. Serverless clusters offer the same service level agreement (SLA) as common clusters to ensure stability.
High scalability
Wide scaling range
A single cluster can be scaled between 0 and 1,000 CPU cores without interrupting business.
Scalability in seconds
Workload detection is accomplished in five seconds and cluster resources are scaled up within a second when your workloads increase. If your workloads decrease, cluster resources are automatically scaled down in a tiered manner.
No business interruption
The scaling process has no impact on business.
Strong data consistency
Global consistency (high-performance mode) is provided. Clusters support strong data consistency. Data can be read immediately after it is written to read-only nodes, while the performance is almost the same as in weak consistency mode.
Cost-effectiveness
Serverless clusters are billed in PCUs in the pay-as-you-go billing method. This reduces costs by up to 80%.
Zero O&M
The PolarDB serverless team is responsible for all operations and maintenance work, such as system upgrades, system deployment, scaling, and alert processing. These operations are performed in the background and do not affect the services that are running in the system. This ensures continuous service delivery and allows you to focus on developing your business.
Scenarios
Serverless clusters
Scenarios in which workloads fluctuate dramatically
Scenarios that require infrequent access to databases, such as databases in development and testing environments
Scenarios in which intermittent scheduled tasks are involved, such as teaching and student experiments
Scenarios that handle inconsistent and unpredictable workloads, such as IoT and edge computing
Scenarios that need to reduce O&M costs and improve O&M efficiency
Serverless clusters with defined specifications
Scenarios in which workloads fluctuate dramatically
Scenarios that handle inconsistent and unpredictable workloads, such as IoT and edge computing
Scenarios that need to reduce O&M costs and improve O&M efficiency
Scenarios that need to satisfy fluctuation requirements based on existing PolarDB clusters.
Prerequisites
Serverless clusters
The serverless feature is unavailable for PolarDB for MySQL 5.6 clusters.
Serverless clusters with defined specifications
The clusters must meet the following requirements:
Database engine:
PolarDB for MySQL 5.7 whose revision version is 5.7.1.0.29 or later.
PolarDB for MySQL 8.0.1 whose revision version is 8.0.1.1.30.1 or later.
PolarDB for MySQL 8.0.2 whose revision version is 8.0.2.2.19 or later.
PolarProxy must be 2.4.30 or later.
The serverless feature is unavailable for Standard Edition clusters.
The serverless feature is unavailable for PolarDB for MySQL 5.6 clusters.
Limits
Serverless clusters
The following features are not supported:
Manually scale up or scale down the storage capacity (for Enterprise Edition)
Manually scale down the storage capacity (for Standard Edition)
Global Database Network (GDN) is supported, but is subject to the following limits:
Automatic start and stop cannot be enabled on all serverless clusters in a GDN.
Each serverless cluster in the GDN must have at least one read-only node if the cluster meets the following requirements:
PolarDB for MySQL 8.0.1 whose revision version is 8.0.1.1.42 or later.
PolarDB for MySQL 8.0.2 whose revision version is 8.0.2.2.23 or later.
The following operations are supported: add or remove read-only nodes, manually upgrade or downgrade a PolarDB cluster, perform a temporary cluster upgrade, perform auto scaling of local resources, and perform auto scaling for clusters that do not support serverless.
The In-Memory Column Index (IMCI) feature is supported for serverless clusters that contain at least one read-only node. Before you can add read-only column store nodes to a serverless cluster, you must set the Minimum Read-only Nodes parameter to 1 for the serverless cluster.
Serverless clusters with defined specifications
You cannot enable the serverless feature for a single-node cluster for which PolarProxy is not configured. To enable the serverless feature for such a cluster, add read-only nodes to the cluster. For more information, see Add a read-only node. You can enable the serverless feature for a new single-node cluster that meets the version requirements.
The following feature is not supported: Manually scale up or scale down the storage capacity (for Enterprise Edition)
Global Database Network (GDN) is supported, but is subject to the following limits:
Automatic start and stop cannot be enabled on all serverless clusters in a GDN.
Each serverless cluster in the GDN must have at least one read-only node if the cluster meets the following requirements:
PolarDB for MySQL 8.0.1 whose revision version is 8.0.1.1.42 or later.
PolarDB for MySQL 8.0.2 whose revision version is 8.0.2.2.23 or later.
Auto scaling of local resources and Auto scaling for clusters that do not support serverless. If the Serverless feature is enabled on a cluster with defined specifications, you cannot enable these features. Similarly, after you enable these features on a cluster with defined specifications, you cannot enable the serverless feature.
For more information, see Enable the serverless feature for a common cluster with defined specifications.
Pricing
Serverless clusters
The fees include compute node fees, storage capacity fees, backup storage fees (only for the part exceeding the free quota), and SQL Explorer fees (optional). For more information, see Billing.
Serverless clusters with defined specifications
The fees include the fees of the resources with defined specifications and the fees of the serverless resources. For information about the fees of the resources with defined specifications, see Billable items. For information about the fees of the serverless resources, see Billing.