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 | Serverless clusters: clusters whose billing method is Serverless. Serverless clusters with defined specifications: clusters whose billing method is subscription or pay-as-you-go when created and later have the serverless feature manually enabled. Defined specifications refer to the fixed compute node specifications of the cluster whose billing method is subscription or pay-as-you-go.
|
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 |
Serverless cluster | Serverless cluster with defined specifications |
 |  |
PolarProxy PolarProxy uses a serverless architecture. PolarProxy resources are independent of compute nodes and automatically scaled. You do not need to define PolarProxy resources. The serverless resources are scaled in units of 0.5 PCUs. The number of PCUs added or removed in a scaling activity is positively correlated with the number of PCUs used.
Compute nodes The primary node and read-only nodes of a serverless cluster adopt a serverless architecture. The nodes can scale with workloads and share storage in a zone. The number of PCUs increases or decreases based on the scaling of the primary node or read-only nodes. The serverless resources are scaled in units of 0.5 PCUs. The number of PCUs added or removed in a scaling activity is positively correlated with the number of PCUs used. You can set the scaling range of a node in PCUs. The system monitors the PCUs of a compute node every second.
Storage The storage of a serverless cluster uses the pay-as-you-go billing method. You do not need to specify the storage capacity when you purchase the cluster. The storage capacity is automatically increased when the amount of data increases. You are charged only for the storage space that you use. You can view Database Storage Usage on the Basic Information page of the cluster. For more information, see View the database storage usage.
Note The maximum number of connections to a serverless cluster is 100,000, and the maximum IOPS of a serverless cluster is 84,000. Serverless clusters support the No-activity Suspension feature. By default, this feature is disabled. If your serverless cluster does not receive requests within specific periods of time, you can configure the automatic start and stop feature for the instance. After you enable this feature and if no service is connected to the cluster within the period defined by the Detection Period for No-activity Suspension parameter, the cluster automatically enters the suspended state. During the suspension period, you are still charged for the storage space on a pay-as-you-go basis. If any service is connected to the cluster, the cluster immediately starts.
| PolarProxy PolarProxy uses a serverless architecture. PolarProxy resources are independent of compute nodes and automatically scaled. You do not need to define PolarProxy resources. The serverless resources are scaled in units of 0.5 PCUs. The number of PCUs added or removed in a scaling activity is positively correlated with the number of PCUs used.
Compute nodes The primary node and read-only nodes of a serverless cluster adopt a serverless architecture. The nodes can scale with workloads and share storage in a zone. The number of PCUs increases or decreases based on the scaling of the primary node or read-only nodes. The serverless resources are scaled in units of 0.5 PCUs. The number of PCUs added or removed in a scaling activity is positively correlated with the number of PCUs used. You can set the scaling range of a node in PCUs. The system monitors the PCUs of a compute node every second.
Storage The storage of a serverless cluster uses the pay-as-you-go billing method. You do not need to specify the storage capacity when you purchase the cluster. The storage capacity is automatically increased when the amount of data increases. You are charged only for the storage space that you use. You can view Database Storage Usage on the Basic Information page of the cluster. For more information, see View the database storage usage.
|
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.
Note
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
Serverless clusters with defined specifications
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
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
Serverless for clusters with defined specifications
To enable the serverless feature for an existing cluster with defined specifications, make sure that the cluster meets the following version requirements:
Limits
Serverless clusters
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)
X-Engine is supported for clusters of the following versions:
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:
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.
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.
To view the bills, log on to the Expenses and Costs console. On the Billing Details page, select PolarDB - Serverless in the Product field. For more information, see Bill details.
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.