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.
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.
NoteThe 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
Serverless clusters with defined specifications
Trigger conditions for the scaling of serverless resources
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.