All Products
Search
Document Center

PolarDB:Overview

Last Updated:Jul 16, 2024

PolarDB for MySQL serverless uses shared storage and adopts the architecture that consists of one primary node and multiple read-only nodes to implement dynamic scaling based on system workloads. PolarDB for MySQL serverless implements scaling (scale-in/out and scale-up/down) of read-only nodes in a cluster within seconds to make full use of the computing resources of the cluster and reduce business costs. This topic describes how a serverless cluster works and its benefits and application scenarios.

Background information

Databases are an important part of the IT system of modern enterprises. When you create a database cluster, a conservative approach is adopted to configure resources, such as CPU, memory, storage, and connections, to ensure that the cluster can run smoothly even during peak hours. In this case, your resources are idle during off-peak hours and may be insufficient during peak hours. To resolve this issue, serverless clusters are provided by PolarDB for MySQL. Serverless clusters provide resource scaling that is based on workloads and eliminate the need to evaluate and manage business resources.

The following figure shows the resource usage and specifications of common clusters and serverless clusters in scenarios with high business fluctuations.普通集群和Serverless集群对比图

  • Common cluster: A large number of resources are wasted during off-peak hours. Resources are insufficient and business cannot be processed during peak hours.

  • Serverless cluster:

    • Dynamically scales resources based on workloads. This enhances resource utilization and reduces resource waste.

    • Completes resource scaling within one second without interrupting business and provides sufficient resources during peak hours. This ensures business performance and system stability.

    • Supports the pay-as-you-go billing method. This reduces costs and ensures that resources are dynamically allocated to align with workloads.

    • Requires no manual configuration changes. This improves O&M efficiency.

    • Supports the automatic start and stop feature. When no requests are sent to the cluster, the cluster is automatically suspended to release computing resources. When the cluster receives requests, the cluster automatically starts.

      Note

      The automatic start and stop feature is not supported for a serverless cluster with defined specifications.

    • Optimizes high-throughput write operations and high-performance batch processing operations and supports elastic scaling. This is suitable for scenarios in which large amounts of data and large traffic fluctuations are involved.

How it works

PolarDB for MySQL serverless supports real-time scaling of CPU, memory, storage, and network resources. PolarDB for MySQL uses a new architecture in which computing and storage are separated. Serverless clusters also allow you to isolate network resources, namespaces, and storage resources. Serverless clusters support the pay-as-you-go billing method for computing resources and provide the following benefits: low resource usage, ease of use, flexibility, and low price. Serverless clusters can help you quickly and independently scale computing resources to adapt to fluctuating workloads, reduce costs, and improve efficiency.

Terms

  • Serverless cluster: a serverless cluster that you create. For information about how to create a serverless cluster, see Create a serverless cluster.

  • Serverless cluster with defined specifications: a common cluster that has the serverless feature enabled. For information about how to enable the serverless feature, see Enable the serverless feature.

  • Scale-up/down: the change of the CPU and memory of nodes in a cluster.

  • Scale-in/out: the change of the number of read-only nodes in a cluster.

Serverless clusters

Architecture of a serverless cluster计算架构

  • Scaling of the PolarProxy of a serverless cluster

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

    • Serverless proxy resources are measured in PolarDB capacity units (PCUs). A PCU is approximately equal to 1 core and 2 GB of memory, and 0.5 PCUs are approximately equal to 0.5 cores and 1 GB of memory.

  • Scaling of the compute nodes of a serverless cluster

    • The primary node and read-only nodes of a serverless cluster adopt a serverless architecture. The nodes can scale with workloads and share distributed storage within a single zone.

    • Serverless computing resources are measured in PCUs. The number of PCUs increases or decreases based on the scaling of the primary node or read-only nodes. A PCU is approximately equal to 1 core and 2 GB of memory, and 0.5 PCUs are approximately equal to 0.5 cores and 1 GB of memory.

    • Nodes are scaled in units of 0.5 PCUs. The number of CPUs added or removed in a scaling activity is positively correlated with the number of CPUs used by a node.

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

  • Scaling of the storage of a serverless cluster

    The storage of a serverless cluster uses a serverless architecture. 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 that you use. You can view the database storage usage on the Basic Information page of the cluster.Database Storage Usage 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 input/output operations per second (IOPS) of a serverless cluster is 84,000.

Serverless clusters with defined specifications

Architecture of a serverless cluster with defined specifications固定规格的serverless功能

  • PolarProxy of a serverless cluster with defined specifications

    • The PolarProxy is composed of the proxy resources of a common cluster and the serverless proxy resources. The proxy resources of a common cluster are specified when the common cluster is created. Serverless proxy resources are independent of compute nodes and automatically scaled. You do not need to define serverless proxy resources.

    • Serverless proxy resources are measured in PCUs. A PCU is approximately equal to 1 core and 2 GB of memory, and 0.5 PCUs are approximately equal to 0.5 cores and 1 GB of memory. Nodes are scaled in units of 0.5 PCUs. The number of CPUs added or removed in a scaling activity is positively correlated with the number of CPUs used by a node.

  • Scaling of compute nodes of a serverless cluster with defined specifications

    • For a serverless cluster with defined specifications, the resources of the primary node and read-only nodes include defined-specification resources and serverless resources. The defined-specification resources cannot be scaled, while the serverless resources can be scaled based on workloads.

    • Serverless compute nodes are measured in PCUs. A PCU is approximately equal to 1 core and 2 GB of memory, and 0.5 PCUs are approximately equal to 0.5 cores and 1 GB of memory. Nodes are scaled in units of 0.5 PCUs. The number of CPUs added or removed in a scaling activity is positively correlated with the number of CPUs used by a node.

    • The number of PCUs increases or decreases based on the scaling of the primary node or read-only nodes. The system monitors the PCUs of a compute node every second.

    • You can set the scaling range of a single node in PCUs.

  • Storage of a serverless cluster with defined specifications

    The storage of the common cluster with defined specifications is used. For more information, see Overview.

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.

Trigger conditions for the scaling of serverless resources

Note
  • The following conditions apply to both serverless clusters and serverless clusters with defined specifications.

  • Except for the threshold of CPU utilization, the thresholds described in this section are default values. These thresholds vary based on cluster kernel parameters and serverless configuration policies.

Trigger conditions for resource scale-up and scale-out

  • Trigger conditions for resource 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 when one of the following conditions is met:

    • You can specify a CPU utilization threshold. The default threshold is 80%. When the CPU utilization of a single node is higher than 80%, the scale-up of the CPU specifications of the node is triggered.

    • When the memory usage of a single node is higher than 90%, the scale-up of the memory specifications of the node is triggered.

    • 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 no less than 5 PCUs.

  • Trigger conditions for resource scale-out

    When a read-only node is scaled up to the maximum specifications and the business workloads are still higher than the threshold for a scale-up (CPU utilization is higher than 80% or memory usage is higher than 90%), the scale-out of read-only nodes is triggered.

Trigger conditions for resource scale-down

When the CPU utilization of a single node is lower than 50% and the memory usage is lower than 80%, the scale-down of the node is triggered.

Billing

  • Fees of a serverless cluster

    The fees of a serverless cluster include compute node fees, storage capacity fees, backup storage fees for storage that exceeds the free quota, and SQL Explorer fees (optional). For more information, see Billing.

  • Fees of a serverless cluster with defined specifications

    The fees of a serverless cluster with defined specifications include the fees of the common cluster and the fees of the serverless feature. For information about the fees of a common cluster, see Billable items. For information about the fees of the serverless feature, see Billing.

Benefits

PolarDB for MySQL serverless can dynamically scale cluster resources in seconds based on workloads. PolarDB for MySQL serverless 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

      PolarDB for MySQL serverless supports automatic scaling and provides a wide scaling range. A single cluster can be scaled between 0 and 1,000 cores without interrupting business.

    • Scalability in seconds

      Workload detection is accomplished in five seconds and cluster resources are scaled out within a second when your workloads increase. If your workloads decrease, cluster resources are automatically released in a tiered manner.

    • No business interruption

      The scaling process has no impact on business.

  • Strong data consistency

    Global consistency is provided in high-performance mode. 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 for MySQL 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

  • Infrequent access to databases, such as development and test environments.

  • Software as a service (SaaS) scenarios, such as website building of small and medium-sized enterprises.

  • Individual developers.

  • Educational scenarios, such as teaching and student experiments.

  • Uncertain load scenarios, such as IoT and edge computing.

  • Scenarios in which services are changing or unpredictable.

Serverless clusters with defined specifications

  • Enterprise-level databases for medium- and large-sized users.

  • Satisfying fluctuation requirements based on existing PolarDB for MySQL clusters.

Limits

Serverless clusters

  • The serverless feature is unavailable for PolarDB for MySQL 5.6 clusters.

  • The serverless feature is unavailable for Multi-master Cluster (Database/Table) Edition clusters. For more information about the edition, see Overview.

  • The serverless feature is available for X-Engine Edition clusters. For more information about the edition, see Overview. The serverless feature is supported for serverless clusters that run one of the following versions: PolarDB for MySQL 8.0.1 whose revision version is later than 8.0.1.1.41 or PolarDB for MySQL 8.0.2 whose revision version is later than 8.0.2.2.23.

  • The serverless feature automatically supports the following operations: add or remove read-only nodes, manually upgrade or downgrade a PolarDB cluster, perform a temporary cluster upgrade, automatically scale local resources, and perform auto scaling. For more information about the operations, see Add or remove read-only nodes, Manually change the specifications of a cluster, Perform a temporary cluster upgrade, Auto scaling of local resources, and Auto scaling for clusters that do not support serverless.

  • The serverless feature does not support the management of cluster endpoints. For more information, see Apply for a public cluster endpoint or a primary endpoint.

  • The serverless feature supports global database networks (GDNs). For more information, see Overview. All clusters in a GDN cannot be automatically started or stopped. Each cluster must have at least one read-only node.

  • The serverless feature does not support manual scale-in/down.

Serverless clusters with defined specifications

  • Cluster versions:

    • If the major version of the cluster is PolarDB for MySQL 5.7, the minor version of the cluster is PolarDB for MySQL 5.7.1.0.29 or later.

    • If the major version of the cluster is PolarDB for MySQL 8.0.1, the minor version of the cluster is PolarDB for MySQL 8.0.1.1.30.1 or later.

    • If the major version of the cluster is PolarDB for MySQL 8.0.2, the minor version of the cluster is PolarDB for MySQL 8.0.2.2.19 or later.

    • The version of PolarDB PolarProxy is 2.4.30 or later.

    • The serverless feature cannot be enabled for an existing common cluster with defined specifications that runs PolarDB for MySQL 5.6.

    • The serverless feature cannot be enabled for an existing common cluster with defined specifications of PolarDB for MySQL Standard Edition.

  • The serverless feature is unavailable for Multi-master Cluster (Database/Table) Edition clusters. For more information about the edition, see Overview.

  • The serverless feature is available for X-Engine Edition clusters. For more information about the edition, see Overview. The feature is supported for serverless clusters that run one of the following versions: PolarDB for MySQL 8.0.1 whose revision version is later than 8.0.1.1.41 or PolarDB for MySQL 8.0.2 whose revision version is later than 8.0.2.2.23.

  • The serverless feature cannot be enabled along with the automatic scaling of local resources and automatic configuration change (auto scaling) features. For more information, see Auto scaling of local resources and Auto scaling for clusters that do not support serverless. After you enable the serverless feature for a cluster with defined specifications, you cannot enable the automatic scaling of local resources and automatic configuration change (auto scaling) features. Similarly, after you enable the automatic scaling of local resources and automatic configuration change (auto scaling) features for a cluster with defined specifications, you cannot enable the serverless feature for the cluster.

  • The serverless feature cannot be enabled for a cluster with only one primary node. If you want to enable the serverless feature, you must add read-only nodes. For more information, see Add a read-only node.

  • The serverless feature can be enabled for a GDN. However, all clusters in the GDN cannot be automatically started or stopped. Each cluster must have at least one read-only node.

  • The serverless feature does not support manual scale-in/down.