Serverless is a dynamic, elastic scaling capability of PolarDB clusters. Each node in a PolarDB cluster can elastically scale up within seconds to handle sudden workload surges without affecting ongoing operations and automatically scale down during periods of low business loads to optimize cost efficiency.
Background information
Databases are an important part of modern enterprise IT systems. When you create a database, you must carefully configure the resources of the database, including parameters such as CPU, memory, storage, and the number of connections, to ensure smooth operation of the database during peak and off-peak business periods. However, this approach often leads to resource underutilization and unnecessary costs during low-demand periods. During high-demand periods, the cluster may struggle to handle the increased loads due to insufficient resources. A serverless database can effectively address this issue. A serverless database can automatically scale up or down resources based on real-time business workloads. This eliminates the need for complex resource evaluation and O&M overhead.
The following figure shows the resource specification changes of common and serverless clusters in scenarios in which the business workloads fluctuate.

The preceding figure provides the following information:
Common cluster: Low resource utilization during low-demand periods translates into wasted costs, whereas insufficient resources during high-demand periods affect service performance.
Serverless cluster:
Dynamically adjusts resource specifications based on workloads. This improves resource utilization and reduces resource waste.
Quickly scales up or down resources based on changing workloads. This ensures performance and service stability even during peak hours.
Breaks away from the traditional fixed-resource pricing model by using the pay-as-you-go billing method. Users are charged based on actual resource usage, which results in substantial cost savings.
Specifically optimized for high-throughput write scenarios and high-concurrency scenarios. These optimizations combined with elastic scaling capabilities make serverless clusters suitable for businesses that handle large amounts of data and experience fluctuating traffic patterns.
Automatically adjusts configurations without the need for manual intervention, which increases operational efficiency and saves time and labor costs.
Overview
The serverless feature provides real-time scaling elasticity for CPU, memory, storage, and network resources. The feature provides vertical resource isolation for network resources, namespaces, and storage space, and on-demand billing for computing and storage resources. This enables the flexible allocation of compute and storage resources based on actual business requirements. This capability enables the cluster to quickly and independently adjust computing and storage capacities in response to fluctuations in workload such as peaks and troughs. As a result, businesses can rapidly respond to changes in workload while optimizing cost efficiency.
Item | Description |
Implementation model |
|
Scaling method |
|
PCU (PolarDB Capacity Unit) | PCUs are the unit for second-level billing and resource scaling for the serverless feature. One PCU is approximately equal to 1 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 feature of a cluster with defined specifications |
Note The maximum number of connections to a serverless cluster is 100,000, and the maximum IOPS of a serverless cluster is 84,000. |
Note After you enable the serverless feature for an existing cluster with defined specifications, the maximum number of connections to the cluster and the maximum IOPS of the cluster are proportional to the specified value of the Maximum Resources for Single Node parameter. |
Auto scaling
Trigger conditions for resource scale-up and scale-out
Trigger conditions for resource scale-up
PolarDB monitors the CPU utilization, memory utilization, and other kernel metrics of the primary and read-only nodes. During a monitoring cycle, the scale-up of serverless resources is triggered when one of the following conditions is met:
When the CPU utilization of a node exceeds 85%, a resource scale-up is triggered for the node.
When the memory utilization of a node exceeds 85%, a resource scale-up is triggered for the node.
When the specifications of a read-only node are less than half of the specifications of the primary node, the scale-up of the specifications of the read-only node is triggered. 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 to at least 5 PCUs.
Trigger conditions for resource scale-out
If the resources of read-only nodes of a cluster are scaled up to the specified upper limit, but the CPU utilization or memory utilization of the nodes still meets the trigger conditions for a resource scale-up (higher than 85%), a scale-out of read-only nodes is triggered.
Trigger conditions for resource scale-down
When the CPU utilization of a node is lower than 55% and the memory utilization is lower than 40%, a resource scale-down is triggered for the node.
The preceding thresholds are default values. The thresholds vary based on the kernel parameters and serverless configurations of clusters.
Benefits
The serverless feature can dynamically scale cluster resources in seconds based on real-time business loads. The serverless feature provides the following benefits:
High availability
The multi-node architecture ensures high availability and stability of serverless clusters.
High scalability
Wide scaling range: Automatic vertical scaling and horizontal scaling are supported.
Scaling within seconds: When your workloads increase, workload detection is completed in 5 seconds and cluster resources are scaled out within 1 second. If your workloads decrease, cluster resources are automatically released by tier.
Strong data consistency
The serverless feature supports global consistency and ensures strong data consistency within the cluster. Data written to the cluster is immediately available for reading on read-only nodes with the performance almost the same as the performance in weak consistency mode.
NoteBy default, the global consistency feature is disabled. You can manually enable the feature on the cluster endpoint. For more information, see Global consistency.
Cost-effectiveness
Serverless clusters are billed in PCUs based on the pay-as-you-go billing method. Costs can be reduced 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 dramatically fluctuate
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 feature of clusters with defined specifications
Scenarios in which workloads dramatically fluctuate
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 meet fluctuation requirements based on existing PolarDB clusters
Supported versions
Serverless clusters
To create a PolarDB for PostgreSQL serverless cluster, you can specify only the Standard Edition and the PolarDB for PostgreSQL 14 database engine version.
Serverless feature of clusters with defined specifications
Your PolarDB for PostgreSQL cluster must meet the following requirements:
Database Edition: Enterprise Edition.
Specification: Dedicated.
Database Engine: PostgreSQL 14 whose revision version is 14.13.27.0 or later.
Limits
Serverless clusters
The following features are not supported:
Add custom cluster endpoints to a serverless cluster.
Manually add nodes to or manually change the specifications of a serverless cluster.
Serverless feature of clusters with defined specifications
The serverless feature cannot be enabled for a PolarDB for PostgreSQL cluster with defined specifications for which the hot standby storage cluster feature is enabled.
Disable the hot standby storage cluster for the cluster with defined specifications and then enable the serverless feature. For more information, see Create a multi-zone cluster and change the primary zone.
For information about the usage notes, see Enable the serverless feature for a cluster with defined specifications.
Billing
Serverless clusters
The fees include compute node fees, storage fees, backup storage fees (only for the part exceeding the free quota), and SQL Explorer fees (optional). For more information, see Billing.
NoteAlibaba Cloud provides a 50% launch discount for PolarDB for PostgreSQL serverless clusters. For more information, see Launch of the PolarDB for PostgreSQL serverless cluster.
Serverless-enabled clusters with defined specifications
The fees include the fees of the cluster with defined specifications and the fees related to the serverless feature. For information about the fees of the cluster with defined specifications, see Billable items. For information about the fees related to the serverless feature, see Billing.