All Products
Search
Document Center

PolarDB:Serverless

Last Updated:Nov 20, 2025

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:

普通集群和Serverless集群对比图

  • Common cluster:

    Resources are wasted during off-peak hours. Resources are insufficient and business cannot be processed during peak hours.

  • Serverless clusters

    • Resources are dynamically scaled based on workloads. This enhances resource usage and reduces resource waste.

    • Resources are scaled within one second without interrupting business. Sufficient resources are provided during peak hours. This ensures business performance and system stability.

    • The pay-as-you-go billing method is supported. This reduces costs and ensures that resources are dynamically allocated based on workloads.

    • No manual configuration changes are required. This improves O&M efficiency.

Features

The serverless feature provides real-time elasticity for CPU, memory, storage, and network resources. It offers vertical resource isolation for network resources and storage space. It also supports pay-as-you-go billing and the elastic allocation of computing and storage resources. This lets you quickly and independently adjust computing and storage capabilities during business peaks and troughs. This enables a rapid response to business changes while optimizing costs, which helps enterprises reduce expenses and improve efficiency.

Introduction

Description

Display format

  • Serverless clusters: clusters whose billing method is Serverless.

  • Serverless feature for clusters with defined specifications: clusters whose billing method is subscription or pay-as-you-go and later have the serverless feature manually enabled.

    Defined specifications refer to the fixed compute node specifications of a cluster whose billing method is subscription or pay-as-you-go.

Scaling method

  • Scale-up/down: The specifications (CPU and memory) of compute nodes change.

  • Scale-in/out: The number of read-only nodes changes.

PCU (PolarDB Capacity Unit)

The serverless feature uses PolarDB Capacity Unit (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 are dynamically adjusted within the specified range based on the workloads. The minimum scaling increment is 0.5 PCU.

Format

Serverless cluster

Serverless feature for clusters with defined specifications

imageimage
  • Database proxy

    • The database proxy uses a serverless architecture. Database proxy resources are independent of compute nodes and automatically scaled. You do not need to define database proxy resources.

    • The default scaling increment is 0.5 PCU. The scaling increment is dynamically adjusted based on the current PCU usage. The more PCUs are used, the larger the scaling increment.

  • Compute nodes

    • The primary node (RW node) and read-only nodes (RO nodes) adopt a serverless architecture. The nodes scale with workloads and use shared storage in a single zone.

    • When the primary node or a read-only node scales, the number of PCUs of the node increases or decreases.

    • The default scaling increment is 0.5 PCU. The scaling increment is dynamically adjusted based on the current PCU usage. The more PCUs are used, the larger the scaling increment.

    • You can set the scaling range of a single node in PCUs. The system monitors the PCUs of a compute node every second.

  • Storage space

    Storage space uses the pay-as-you-go billing method. You do not need to specify the storage capacity at the time of purchase. The storage capacity automatically scales out as your data grows. 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 connections for a serverless cluster is 100,000, and the maximum IOPS is 84,000.

  • Serverless clusters support the No-activity Suspension feature. By default, this feature is disabled. If your database does not receive requests within specific periods of time, you can enable the No-activity Suspension feature. After you enable this feature, if no service is connected to the cluster within the period specified for the Detection Period For No-activity Suspension parameter, the cluster automatically enters a 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 automatically.

  • Database proxy

    • The database proxy uses a serverless architecture. Database proxy resources are independent of compute nodes and automatically scaled. You do not need to define database proxy resources.

    • The default scaling increment is 0.5 PCU. The scaling increment is dynamically adjusted based on the current PCU usage. The more PCUs are used, the larger the scaling increment.

  • Compute nodes

    • The primary node (RW node) and read-only nodes (RO nodes) adopt a serverless architecture. The nodes scale with workloads and use shared storage in a single zone.

    • When the primary node or a read-only node scales, the number of PCUs of the node increases or decreases.

    • The default scaling increment is 0.5 PCU. The scaling increment is dynamically adjusted based on the current PCU usage. The more PCUs are used, the larger the scaling increment.

    • You can set the scaling range of a single node in PCUs. The system monitors the PCUs of a compute node every second.

  • Storage space

    Storage space uses the pay-as-you-go billing method. You do not need to specify the storage capacity at the time of purchase. The storage capacity automatically scales out as your data grows. 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

Scaling

Trigger conditions for scale-up and scale-out

  • Scale-up (node upgrade)

    PolarDB monitors the CPU utilization, memory usage, and other kernel-level metrics of the primary and read-only nodes. During a monitoring cycle, a scale-up is typically triggered for a node when one of the following three situations occurs:

    • The CPU utilization is higher than the preset threshold (default 80%).

    • The memory usage 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 a read-only node has specifications of 4 PCU and the primary node has specifications of 10 PCU, the read-only node is scaled up to at least 5 PCU.

  • Scale-out (add a node)

    If a read-only node in a cluster is scaled up to its maximum specifications and the scale-up threshold is still met (for example, if the CPU utilization is higher than the custom threshold), a scale-out of read-only nodes is triggered.

Trigger conditions for scale-down and scale-in

  • Scale-down (node downgrade)

    A scale-down is triggered for a node when its CPU utilization is below the custom threshold (default 50%) and its memory usage is below 80%.

  • Scale-in (remove a node)

    A scale-in is triggered for a read-only node if its CPU utilization stays below 15% and the CPU utilization of all other read-only nodes stays below 60% for 15 to 30 minutes.

    Note
    • To prevent node jitter, only one read-only node is scaled in at a time. The quiescent period between consecutive scale-in activities is 15 to 30 minutes.

    • If you want to immediately scale in all read-only nodes, you can modify the Serverless Configuration. If you set both the Maximum Number of Read-only Nodes and Minimum Number of Read-only Nodes to 0, a scale-in of all read-only nodes is immediately triggered.

Note
  • The scaling range is determined by the maximum and minimum number 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 parameter configurations and serverless configurations. You can specify a threshold for CPU utilization, but you cannot change the thresholds for other metrics.

  • When the service traffic of a cluster suddenly increases, the nodes of the cluster are scaled up incrementally to approach the expected specifications, instead of all at once. The minimum scaling increment is 0.5 PCU. To quickly adapt to the current service traffic, the next scaling increment is automatically adjusted based on the current number of PCUs.

  • You can configure alert rules in Performance Monitoring in the console to receive timely notifications when cluster nodes are scaled down. For more information about how to configure alert rules, 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

  • Clusters whose database engine is MySQL 5.6 are not supported.

  • The serverless feature is unavailable for clusters whose CPU architecture is YiTian ARM.

Serverless feature for clusters with defined specifications

To enable the serverless feature for a cluster with defined specifications, make sure that the cluster meets the following version requirements:

  • Engine version:

    • MySQL 5.6: Not supported.

    • MySQL 5.7: The minor engine version must be 5.7.1.0.29 or later.

    • MySQL 8.0.1: The minor engine version must be 8.0.1.1.30.1 or later.

    • MySQL 8.0.2: The minor engine version must be 8.0.2.2.19 or later.

  • Database proxy (Proxy) version: Must be 2.4.30 or later.

  • CPU Architecture: Must be X86. YiTian ARM is not supported.

Limits

Serverless clusters

Serverless feature for clusters with defined specifications

  • Single-node clusters without a database proxy do not support the serverless feature because they do not meet the prerequisites. To enable the feature, add a read-only node. Newly purchased single-node clusters that meet the version requirements support the serverless feature by default.

  • Enterprise Edition: Manual scale up or down storage space is not supported.

  • The global database network (GDN) feature is supported with the following limitations:

    • No-activity Suspension cannot be set for any cluster in the GDN.

    • When the database engine version meets the following conditions, all clusters in the GDN must have at least one read-only node:

      • MySQL 8.0.1 with a minor engine version earlier than 8.0.1.1.42.

      • MySQL 8.0.2 with a minor engine version earlier than 8.0.2.2.23.

  • The serverless feature and the Elastic scaling with auto scaling feature are mutually exclusive. This means that on a cluster with defined specifications, you cannot enable the serverless feature if the Elastic scaling with auto scaling feature is enabled, and you cannot enable the Elastic scaling with auto scaling feature if the serverless feature is enabled.

Note

For more information about version requirements and limits, see Enable the serverless feature for a cluster with defined specifications.

Pricing

  • Serverless clusters

    • The fees include compute node fees, storage space fees, backup storage fees (only for the part that exceeds the free quota), and SQL Explorer fees (optional). For more information, see Serverless billing.

    • You can view your bills on the Expenses and Costs page. On the Bill Details page, select PolarDB-Serverless from the Product Name drop-down list. For more information, see Bill details.

  • Serverless feature for clusters with defined specifications

    The fees include the costs for resources with defined specifications and the costs for serverless resources. For more information about the costs for resources with defined specifications, see Billable items. For more information about the costs for serverless resources, see Billing.