Create a serverless cluster

更新时间:
复制 MD 格式

When creating a Serverless cluster, you do not specify fixed specifications for each compute node. Instead, you only need to define the scaling range for the number of read-only nodes and the PCU scaling range for each node. PolarDB automatically scales the cluster's primary and read-only nodes within the ranges you define. This topic describes how to create a Serverless cluster.

Note

To use the Serverless feature with an existing database, use Data Transmission Service (DTS) to migrate your data to a new serverless cluster. For more information, see Data Migration Solutions Overview and .

Prerequisites

You have an Alibaba Cloud account and are logged in. For more information, see Sign up for and sign in to an Alibaba Cloud account.

Step 1: Configure basic settings

Basic settings include the billing method, region, availability zone, database engine, and resource scaling range.

Parameter

Description

Billing Method

Serverless

Region

Select a region nearest your users to reduce network latency. The region cannot be changed after the cluster is created. For more information, see Regions and availability zones.

Note

To ensure optimal performance, ensure your PolarDB cluster and the ECS instances that need to connect to it are in the same region. Otherwise, they can communicate only over the public internet, which may degrade performance.

Creation Method

Create the master cluster

Database Engine

Select a database engine version.

  • PostgreSQL 14

  • PostgreSQL 15

  • PostgreSQL 16

Service Edition

Select a product version.

  • Enterprise Edition

  • Standard Edition

Primary Zone

An availability zone is an independent physical location within a region. Availability zones in the same region offer similar connectivity and performance.

Note
  • You can create your PolarDB cluster in the same availability zone as your ECS instances or in a different one.

  • You only need to select the primary availability zone. The system automatically selects a standby availability zone.

Network Type

Configure the Virtual Private Cloud (VPC) and vSwitch.

  • If an existing VPC meets your network requirements, select it. For example, use the VPC where your ECS instances reside.

  • If you do not have a suitable VPC, you can use the default VPC and vSwitch:

    • Default VPC:

      • It is unique within your selected region.

      • It uses a 16-bit subnet mask, such as 192.168.0.0/16, which provides up to 65,536 private IP addresses.

      • It does not count against your VPC quota.

    • Default vSwitch:

      • It is unique within your selected availability zone.

      • It uses a 20-bit subnet mask, such as 192.168.0.0/20, which provides up to 4,096 private IP addresses.

      • It does not count against the vSwitch quota within the VPC.

  • If the default VPC and vSwitch do not meet your requirements, you can create a custom VPC and vSwitch. For more information, see Create and manage a VPC.

Note

To ensure optimal performance, make sure your PolarDB cluster and the ECS instances that need to connect to it are in the same VPC. Otherwise, they cannot communicate over the internal network.

HA Mode

PolarDB provides multiple high availability modes. After you enable the hot standby storage cluster feature for a PolarDB cluster, a hot standby storage cluster is created in the secondary zone of the region in which the PolarDB cluster resides or in a different data center in the same zone. The hot standby storage cluster has independent storage resources. Whether the hot standby storage cluster has independent compute resources varies based on the high availability mode. When the PolarDB cluster in the primary zone fails, the hot standby storage cluster immediately takes over and handles read and write operations and storage tasks.

Note
  • For more information about the hot standby storage cluster and related solutions, see High availability modes (hot standby clusters).

  • Rules for changing high availability modes:

    • You cannot directly change the high availability mode of a cluster from Double Zones (Hot Standby Storage Cluster Enabled) or Double Zones (Hot Standby Storage and Compute Clusters Enabled) to Single Zone (Hot Standby Storage Cluster Disabled).

      For such change of the high availability mode, we recommend that you purchase a new cluster and select the Single Zone (Hot Standby Storage Cluster Disabled) high availability mode for the cluster. Then, migrate the existing cluster to the new cluster by using Data Transmission Service (DTS). For information about how to migrate an existing cluster to a new cluster, see Migration between PolarDB for MySQL clusters.

    • You can select the Three Zones high availability mode only when you purchase a new cluster. You cannot change the high availability mode of a cluster from Three Zones to other high availability modes and vice versa.

  • You can manually change the high availability mode of a cluster from Single Zone (Hot Standby Storage Cluster Disabled) to a different high availability mode. For more information, see High availability modes (hot standby clusters).

Configure resource scaling range for the serverless cluster

  • Minimum Read-only Nodes: The minimum number of read-only nodes. Valid values: 0 to 15 for Enterprise Edition, and 0 to 7 for Standard Edition.

  • Maximum Read-only Nodes: The maximum number of read-only nodes. Valid values: 0 to 15 for Enterprise Edition, and 0 to 7 for Standard Edition.

Note
  • The number of read-only nodes scales automatically within the specified range based on the workload. For more information about the scaling policy, see Auto scaling.

  • To ensure high availability for your Serverless cluster, we recommend that you set the Minimum Read-only Nodes to 1.

  • Minimum PCUs per Node: The minimum number of PCUs for each node in the cluster. Valid values: 1 PCU to 31 PCU.

  • Maximum PCUs per Node: The maximum number of PCUs for each node in the cluster. Valid values: 1 PCU to 32 PCU.

Note
  • Serverless clusters use PolarDB Compute Units (PCUs) for per-second billing and as the unit for resource scaling. One PCU is equivalent to approximately 1 vCPU and 2 GB of memory. The number of PCUs for each node dynamically adjusts within the configured range based on the workload. The minimum scaling increment for a single scaling event is 0.5 PCU.

  • Example: If you set Minimum PCUs per Node to 2 PCU and Maximum PCUs per Node to 16 PCU, the initial specification for the primary and read-only nodes in the serverless cluster is 2 PCU (approximately 2 vCPUs and 4 GB of memory). When the system detects an increased workload, it automatically increases the PCU count for the primary or read-only nodes, up to a maximum of 16 PCU (approximately 16 vCPUs and 32 GB of memory) as configured.

Enable No-activity Suspension

If your database experiences periods of inactivity, you can enable this feature. When enabled, the cluster automatically pauses if there are no active connections within the specified Detection Period for No-activity Suspension. During the pause, you are still charged for storage on a pay-as-you-go basis. The cluster automatically resumes as soon as a connection is established.

Note
  • This feature cannot be enabled on the purchase page.

  • The Detection Period for No-activity Suspension cannot be configured on the purchase page. It defaults to 60 minutes. You can change this setting on the cluster details page after the cluster is created. For more information, see Configure auto or manual start and stop for a Serverless cluster.

Storage Type

  • Enterprise Edition supports the PSL5 and PSL4 storage types:

    • PSL5: A legacy storage type supported in earlier PolarDB versions. It was the default for clusters purchased before June 7, 2022. It offers high performance, reliability, and availability.

    • PSL4: A new storage type introduced by PolarDB that uses Alibaba Cloud's proprietary Smart-SSD technology. Data is compressed and decompressed at the physical SSD level, which lowers storage costs with minimal performance impact.

  • Standard Edition supports only ESSD. ESSDs (Enhanced SSDs) are ultra-high-performance cloud disks offered by Alibaba Cloud. Based on a new-generation distributed block storage architecture, combined with 25GE networking and RDMA technology, ESSDs deliver up to 1 million random read/write IOPS per disk and lower single-path latency. ESSDs are available in the following performance levels:

    • ESSD PL0: The baseline performance level for ESSDs.

    • ESSD PL1: Offers up to 5 times the IOPS and about twice the throughput of PL0.

    • ESSD PL2: Offers about twice the IOPS and throughput of PL1.

    • ESSD PL3: Offers up to 10 times the IOPS and 5 times the throughput of PL2. This level is ideal for applications that require extremely high concurrent I/O performance and stable read/write latency.

    • ESSD AutoPL: With ESSD AutoPL, IOPS are decoupled from capacity. You can flexibly configure and adjust IOPS on demand, which reduces the total cost of ownership (TCO).

      Important
      • For detailed performance metrics of ESSDs, see ESSDs.

      • When the storage space of a cloud disk is full (a 3 GB buffer is reserved to prevent data corruption), the disk is locked and becomes read-only.

      When you select ESSD AutoPL, you can configure the Pre-provisioned IOPS for ESSD AutoPL to increase the baseline maximum IOPS (50,000). The maximum value for pre-provisioned IOPS is 50,000, which means the theoretical total maximum IOPS for an ESSD AutoPL disk is 100,000.

Step 2: Configure advanced settings (optional)

Advanced settings include configurations for the cluster name, resource group, and table name case sensitivity.

Parameter

Description

Cluster Name

  • Auto-generate: The system automatically generates a cluster name. You can change it after creation.

  • Custom: Enter a custom cluster name that meets the following requirements:

    • It cannot start with http:// or https://.

    • The name must be 2 to 256 characters in length.

      If you leave this field empty, the system automatically generates a cluster name. You can still modify the name after the cluster is created.

Resource Group

Select a target resource group from the list of existing resource groups.

Note

A resource group is a container that helps you manage a set of related resources under a single Alibaba Cloud account. Each resource can belong to only one resource group. For more information, see Resource groups and authorization.

Enable TDE

You can enable Transparent Data Encryption (TDE) when you create the cluster, which eliminates the need to enable it separately after creation.

Note

  • TDE cannot be disabled after it is enabled.

  • TDE relies on the Key Management Service (KMS). After you enable TDE, you must configure a service role to authorize PolarDB to access KMS.

  • After you enable TDE, PolarDB encrypts the data files of the cluster. This process is transparent to your applications but can incur a 5% to 10% performance overhead.

Step 3: Confirm your order

Review the cluster configuration, set the purchase quantity, and ensure that all settings meet your requirements.

  1. Review your selected configurations.

  2. Set the Quantity of clusters to create. The default value is 1.

    Note

    You can create up to 50 clusters at once, which is useful for scenarios such as batch server deployments for games.

  3. Read the Product Terms of Service, Service Level Agreement (SLA), and any product-specific terms that you selected on this page.

  4. After you confirm the configurations, click Buy Now.

    Cluster creation takes 10 to 15 minutes. You can then find the new cluster in the cluster list.

    Note
    • The cluster is ready for use only when its status changes from Creating to Running.

    • Ensure you have selected the correct region to find the newly created cluster.