Serverless

Updated at:

Serverless is the dynamic elastic scaling capability of PolarDB. Each node in the cluster can scale out within seconds to handle sudden business load spikes without any impact on business operations. During low-load periods, the mechanism automatically scales in to reduce business costs.

With the Serverless feature, you do not need to worry about resource configuration when creating and using databases. The following shows the resource usage and specification changes of a regular cluster and a Serverless cluster under large business fluctuations:

Comparison between a regular cluster and a Serverless cluster

  • Regular cluster

    Wastes more resources during troughs and lacks resources during peaks, harming business.

  • Serverless cluster:

    • Because its specification can be adjusted at any time according to business demand, overall resource waste is reduced and resource utilization is improved.

    • Cluster resource scaling completes within 1 second and is completely imperceptible to business. Even during peaks, the system fully meets business demand, ensures business is not harmed, and improves system stability.

    • Breaks the fixed-resource billing model and implements a pay-as-you-go model that dynamically matches load with resources, significantly saving costs.

    • No manual configuration adjustment is required, improving O&M efficiency and saving labor and time costs.

Feature overview

Serverless provides real-time elasticity for CPU, memory, storage, and network resources. It offers vertical resource isolation for network resources and storage space, and supports pay-as-you-go billing to elastically allocate compute and storage resources. This allows you to quickly and independently adjust compute and storage capacity in response to business peaks and troughs, respond rapidly to business changes, optimize cost usage, and help enterprises reduce costs and improve efficiency.

Item

Description

Display form

  • Serverless cluster: Billing type is Serverless.

  • Serverless feature for fixed-specification clusters: In clusters whose Billing type is Subscription or Pay-as-you-go, manually enable the Serverless feature.

    Here, fixed specification refers to clusters whose Billing type is Subscription or Pay-as-you-go, where a fixed compute node specification must be selected.

Scaling method

  • Vertical scaling: The specification (CPU and memory) of compute nodes changes.

  • Horizontal scaling : The number of read-only nodes changes.

PCU (PolarDB Capacity Unit)

Serverless uses PCU as the management unit for per-second billing and resource elasticity. 1 PCU is approximately equivalent to the standard service capability of 1 core and 2 GB of memory. The PCU of a node is dynamically adjusted within the upper and lower limits you set based on business load. The minimum PCU unit for a single scaling operation is 0.5 PCU.

Display form

Serverless cluster

Serverless feature for fixed-specification clusters

imageimage
  • Database proxy

    • The database proxy is in Serverless form. Its resources are independent of compute nodes, and you do not need to configure elastic scaling.

    • Scaling is performed in increments of 0.5 PCU by default. The scaling step is dynamically adjusted based on current PCU usage: the larger the current PCU, the relatively larger the scaling step.

  • Compute nodes

    • Both the primary node (RW node) and read-only nodes (RO nodes) are in Serverless form. They scale elastically with business load and use shared storage within a single zone.

    • Whenever the primary node or a read-only node scales out or in, the PCU of the node increases or decreases accordingly.

    • Scaling is performed in increments of 0.5 PCU by default. The scaling step is dynamically adjusted based on current PCU usage: the larger the current PCU, the relatively larger the scaling step.

    • You can set the elastic scaling range of a single node in PCU. The system monitors the PCU of compute nodes once per second.

  • Storage space

    Storage space uses the Pay-as-you-go method. You do not need to select a capacity at purchase. Storage automatically scales online as data grows, and you are charged only for the storage space actually occupied by your data. On the Basic Information page of the cluster, view Database Storage Usage. For detailed steps, see View database storage usage.

Note
  • Serverless: the number of connections and IOPS scale linearly with PCU. The cluster theoretically supports up to 100,000 connections and up to 84,000 IOPS.

  • Serverless supports the automatic start and stop feature, which is disabled by default. If your database has no business requests during certain periods, you can enable the automatic start and stop feature. After it is enabled, if the cluster has no business connections within the configured Detection Period for No-activity Suspension, the cluster automatically enters the paused state. During the pause, storage space is still billed on a pay-as-you-go basis. If any business connection reaches the cluster, the cluster immediately starts automatically.

  • Database proxy

    • The database proxy is in Serverless form. Its resources are independent of compute nodes, and you do not need to configure elastic scaling.

    • Scaling is performed in increments of 0.5 PCU by default. The scaling step is dynamically adjusted based on current PCU usage: the larger the current PCU, the relatively larger the scaling step.

  • Compute nodes

    • Both the primary node (RW node) and read-only nodes (RO nodes) are in Serverless form. They scale elastically with business load and use shared storage within a single zone.

    • Whenever the primary node or a read-only node scales out or in, the PCU of the node increases or decreases accordingly.

    • Scaling is performed in increments of 0.5 PCU by default. The scaling step is dynamically adjusted based on current PCU usage: the larger the current PCU, the relatively larger the scaling step.

    • You can set the elastic scaling range of a single node in PCU. The system monitors the PCU of compute nodes once per second.

  • Storage space

    Storage space uses the Pay-as-you-go method. You do not need to select a capacity at purchase. Storage automatically scales online as data grows, and you are charged only for the storage space actually occupied by your data. On the Basic Information page of the cluster, view Database Storage Usage. For detailed steps, see View database storage usage.

Note

Elastic scaling

Trigger conditions for elastic scale-out

  • Vertical scale-out (node upgrade)

    PolarDB mainly monitors the CPU utilization, memory utilization, and other kernel-level metrics of the primary node and read-only nodes. Within a monitoring cycle, if any of the following three conditions occurs on a single node, vertical scale-out of the node is usually triggered:

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

    • The memory utilization is higher than a specific threshold:

      Serverless form

      Scale-out threshold

      Serverless cluster

      90%

      Serverless feature for fixed-specification clusters

      32 GB or less

      90%

      64 GB

      92%

      128 GB

      96%

      256 GB to 512 GB

      98%

      Other memory specifications

      Vertical scale-out is not supported.

    • The specification of a read-only node is less than half of the specification of the primary node.

      For example, if a read-only node has 4 PCU and the primary node has 10 PCU, vertical scale-out of the read-only node is triggered to a specification of at least 5 PCU.

  • Horizontal scale-out (adding nodes)

    If a read-only node in the cluster has already been vertically scaled out to the configured upper limit and still meets the trigger conditions for vertical scale-out (for example, CPU utilization higher than the custom threshold), horizontal scale-out of read-only nodes is triggered.

Trigger conditions for elastic scale-in

  • Vertical scale-in (node downgrade)

    If the CPU utilization of a single node is lower than the custom threshold (default: 50%) and the memory utilization is lower than a specific threshold, resource scale-in of the node is triggered. The memory thresholds are as follows:

    Serverless form

    Scale-in threshold

    Serverless cluster

    80%

    Serverless feature for fixed-specification clusters

    32 GB or less

    80%

    64 GB

    86%

    128 GB

    90%

    256 GB to 512 GB

    94%

    Other memory specifications

    Vertical scale-out is not supported, so there is no scale-in threshold.

  • Horizontal scale-in (removing nodes)

    If the CPU utilization of a read-only node in the cluster is lower than 15% and the CPU utilization of the other read-only nodes is lower than 60%, and this lasts for 15 to 30 minutes, scale-in of the node is triggered.

    Note
    • To prevent node flapping, only one read-only node is horizontally scaled in at a time, and the quiet period between consecutive node scale-ins is 15 to 30 minutes.

    • If you want to immediately scale in all read-only nodes, you can modify Serverless Configuration to achieve this. Set Maximum Read-only Nodes and Minimum Read-only Nodes both to 0 to immediately trigger scale-in of all read-only nodes.

Note
  • The elastic scaling range is determined by the upper and lower limits of the number of read-only nodes and the upper and lower limits of single-node scaling that you set. For more information, see Configure the resource scaling policy of a Serverless cluster or Configure the Serverless resource scaling policy of a fixed-specification cluster.

  • Under different parameter configurations and Serverless configurations, the metrics used to determine elastic scaling differ. You can customize the CPU utilization threshold, but you cannot change the thresholds of other metrics.

  • When the business load of the cluster surges, the nodes are not scaled to the target specification in one step. Instead, they approach the specification required by the current load through repeated single scaling operations. The minimum step of a single scaling operation is 0.5 PCU. To adapt to the current business traffic faster, the step of the next scaling operation is automatically adjusted based on the current PCU, enlarging the adjustment step.

  • When elastic scale-in occurs on cluster nodes, if you want to be aware of the changes in time, go to Performance Monitoring in the console and configure alert rules. For detailed configuration of alert rules, see Create an alert rule.

Benefits

Serverless can dynamically scale cluster resources in seconds based on business load. Its core benefits are as follows:

  • High availability

    The multi-node architecture ensures Serverless cluster high availability. The service level agreement (SLA) is the same as that of Regular cluster, jointly ensuring Serverless cluster stable operation.

  • High elasticity

    • Wide scaling range

      Supports automatic vertical and horizontal scaling. A single cluster supports imperceptible scaling within 0 to 1,000 cores.

    • Second-level scaling

      Handles sudden business load spikes with ease: detection completes in 5 seconds and scale-out in 1 second. When business load drops, cluster resources automatically scale in stepwise.

    • Imperceptible to business

      The scaling process has no impact on business.

  • Strong data consistency

    supports the Global consistency (high-performance mode), achieving strong data consistency within the cluster. Data is immediately readable on read-only nodes after being written, with performance basically the same as weak consistency.

  • Low cost

    Priced by PCU, truly pay-as-you-go, helping you save costs. Cost reduction can reach up to 80%.

  • Maintenance-free

    All O&M work such as version upgrades, system deployment, scaling, and alert handling is completed by the Alibaba Cloud professional team. Usage is imperceptible, business is unaffected, and the service remains continuously available - truly maintenance-free.

Use scenarios

Serverless cluster

  • Scenarios with obvious business peaks and troughs.

  • Scenarios with infrequent database usage, such as development and test environments.

  • Scenarios with intermittent scheduled tasks, such as school teaching and student experiments.

  • Scenarios with unpredictable loads, such as IoT and edge computing.

  • Scenarios that expect to reduce O&M costs and improve O&M efficiency.

Serverless feature for fixed-specification clusters

  • Scenarios with obvious business peaks and troughs.

  • Scenarios with unpredictable loads, such as IoT and edge computing.

  • Scenarios that expect to reduce O&M costs and improve O&M efficiency.

  • Scenarios that want to keep the existing PolarDB cluster while meeting business fluctuations.

Applicable scope

Serverless cluster

  • Clusters whose kernel version is MySQL 5.6 are not supported.

  • Clusters whose CPU architecture is Yitian ARM are not supported.

Serverless feature for fixed-specification clusters

To enable the Serverless feature on a fixed-specification cluster, the cluster must meet the following version requirements:

  • Kernel version:

    • MySQL 5.6: not supported.

    • MySQL 5.7: the minor kernel version must be 5.7.1.0.29 or later.

    • MySQL 8.0.1: the minor kernel version must be 8.0.1.1.30.1 or later.

    • MySQL 8.0.2: the minor kernel 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, and not Yitian ARM.

Limits

Serverless cluster

Serverless feature for fixed-specification clusters

  • Single-node clusters without a database proxy do not meet the prerequisites and therefore cannot enable the Serverless feature. To enable it, add nodes. Newly purchased single-node clusters that meet the version requirements support the Serverless feature by default.

  • Does not support Enterprise Edition Manually scale storage space out or in.

  • Support for X-Engine (high-compression engine) is available in the following kernel versions:

    • MySQL 8.0.1, and the minor kernel version must be 8.0.1.1.41 or later.

    • MySQL 8.0.2, and the minor kernel version must be 8.0.2.2.23 or later.

  • supports the Global Database Network (GDN), but some features are limited as follows:

    • Automatic start and stop cannot be configured for any cluster in the GDN.

    • When the kernel version meets the following conditions, all clusters in the GDN must have at least one RO node.

      • MySQL 8.0.1, and the minor kernel version is earlier than 8.0.1.1.42.

      • MySQL 8.0.2, and the minor kernel version is earlier than 8.0.2.2.23.

  • Mutually exclusive with elastic scaling through automatic scale-out. After the Serverless feature is enabled on a fixed-specification cluster, these features can no longer be enabled. Likewise, after these features are enabled on a fixed-specification cluster, the Serverless feature can no longer be enabled.

Note

For more version requirements and limits, see Enable the Serverless feature for a fixed-specification cluster.

Billing

  • Serverless cluster

    • Fees include compute node fees, storage space fees, backup storage space fees (charged only when the free quota is exceeded), and SQL Explorer (optional) fees. For details, see Serverless billing.

    • Bill query: On the Expenses and Costs page, select the Bill Details page, and set Product Name to ApsaraDB PolarDB-Serverless.. For details, see Bill Details.

  • Serverless feature for fixed-specification clusters

    Fees consist of two parts: the fees of the fixed-specification cluster and the Serverless fees. For the fees of the fixed-specification cluster, see Billing items overview, Serverless fees, see Serverless billing.

Video introduction

Free trial

Alibaba Cloud provides a database solution experience hall. You can evaluate the dynamic elasticity of the PolarDB Serverless feature online without purchasing any resources.

You can go to PolarDB MySQL Serverless elasticity & price performance observation to try it. For details, see Free trial of PolarDB MySQL Serverless extreme elasticity .