To meet changing business needs with a cost-effective database solution, you can purchase serverless ApsaraDB RDS for PostgreSQL instances. Serverless instances provide real-time elasticity for CPU and memory. This lets you use a pay-as-you-go billing method for computing resources, which reduces costs and improves business flexibility. This topic describes how to create a serverless ApsaraDB RDS for PostgreSQL instance.
Prerequisites
If you use a Resource Access Management (RAM) user to create an ApsaraDB RDS instance, the RAM user must have the AliyunRDSFullAccess permission. For more information about how to grant permissions, see Authorize a RAM user.
Billing
Creating a serverless ApsaraDB RDS for PostgreSQL instance incurs charges. These charges include fees for RDS Capacity Units (RCUs) and storage. For more information about billing, see Serverless billing.
Procedure
You can set Billing Method to Serverless.
Select a Region.
Select the region where you want to create the ApsaraDB RDS instance.
NoteIf your application or client is deployed on an Elastic Compute Service (ECS) instance, create the ApsaraDB RDS instance in the same region as the ECS instance. Otherwise, the ECS instance can access the ApsaraDB RDS instance only over the internet, which prevents optimal performance. You cannot change the region after the ApsaraDB RDS instance is created.
If you connect to the ApsaraDB RDS instance from a device other than an ECS instance, such as a local server or computer, select a region that is geographically close to your device. You can then connect to the ApsaraDB RDS instance using its public endpoint.
Select a database Engine.
This topic uses a serverless ApsaraDB RDS for PostgreSQL instance as an example. Set Engine to PostgreSQL. The supported major engine versions are PostgreSQL 14 or later. PostgreSQL 18 is not supported.
Configure the instance Edition.
Serverless ApsaraDB RDS for PostgreSQL instances support the Basic Edition and High-availability Edition.
Configure the Storage Type for the instance. Serverless ApsaraDB RDS for PostgreSQL instances currently support only the Premium ESSD and ESSD PL1 storage types.
Configure serverless parameters.
NoteYou can modify the serverless parameters after the instance is created. For more information, see Change the scaling range of RCUs, Change the elastic policy of an instance, and Configure the automatic start and stop feature.
Parameter
Description
Example
RDS Capacity Units (RCUs)
The performance of 1 RCU is equivalent to 1 vCPU and 2 GB of memory. The Minimum value is 0.5 RCU and the Maximum value is 32 RCU. After you set the minimum and maximum values, the instance automatically scales its resources within the specified range based on the workload.
NoteThe maximum number of connections is fixed at 2,400 and does not change with the number of RCUs.
Minimum: 0.5 RCU
Maximum: 14 RCU
Scaling Policy
Modify the Elastic Policy. RCU scaling for a serverless instance usually takes effect immediately and does not affect your services. In rare cases, a transient disconnection may occur. You can configure whether to forcefully perform RCU scaling in such cases.
NoteThe probability of a transient disconnection is very low. This is a contingency policy for extreme cases.
Do Not Execute Forcefully
Automatic Stop and Restart
Enable or disable the Automatic Start and Stop feature for the serverless instance. If you enable this feature and no connections are made to the instance for 10 minutes, the instance is automatically suspended.
If the instance is suspended, it automatically resumes when a connection is established.
shutdown
Select a zone for the primary node.
How to select a zone
There is no significant difference between zones in the same region.
An ECS instance that accesses an ApsaraDB RDS instance in the same zone delivers better performance than one that accesses an ApsaraDB RDS instance in a different zone within the same region. However, the performance difference is minor.
NoteIf the target zone is sold out, try another zone.
If the instance Edition is High-availability Edition, you must also select a Deployment Method and a Zone of Secondary Node.
We recommend that you select Multi-zone Deployment. In this deployment mode, the primary and secondary nodes are in different zones within the same region to provide cross-zone disaster recovery.
Set the Storage Capacity.
Drag the slider to select the storage capacity. The selected storage capacity is the minimum amount for which you will be billed. For example, if you select 100 GB of storage when you create a serverless instance, you are charged for 100 GB even if you use less than 100 GB. If your storage usage exceeds 100 GB, the serverless instance automatically scales out, and you are charged for the actual usage.
ImportantThe automatic storage expansion feature is enabled by default for serverless instances and cannot be disabled. After the storage is automatically expanded, it cannot be automatically scaled in. This is to ensure data integrity. Monitor your bills. You can manually scale in the storage. For more information, see Reduce the storage capacity of an ApsaraDB RDS for PostgreSQL instance that uses cloud disks.
Click Next: Instance Configuration.
Select a VPC and a vSwitch of Primary Node.
If you use an ECS instance to connect to the ApsaraDB RDS instance over an internal network, select the same VPC as the ECS instance. If the ECS instance and the ApsaraDB RDS instance are in different VPCs, they cannot connect to each other over an internal network.
NoteIf the ECS instance and the ApsaraDB RDS instance are in the same VPC but use different vSwitches, they can still connect to each other over an internal network.
If the instance edition is High-availability Edition, you must also select a vSwitch of Secondary Node.
Add to Whitelist: Specifies whether to add the CIDR block of the selected VPC to an IP address whitelist of the RDS instance. Selecting Yes allows ECS instances in the selected VPC to access the RDS instance.
Configure other custom parameters. If you do not have special requirements, you can use the default values.
Parameter
Description
Parameter Template
You can create a custom template in advance and apply it when you create an instance. If you do not specify a template, the system uses the default template. For more information, see Use a parameter template.
Release Protection
You can enable Release Protection for the instance to prevent it from being accidentally released. For more information, see Enable or disable the release protection feature.
Resource Group
Select the default resource group or a custom resource group to facilitate instance management.
Time Zone
Set the time zone for the instance.
Named time zones are supported. UTC time zones are not supported. For more information about named time zones, see Common named time zones for ApsaraDB RDS for PostgreSQL instances.
If you do not configure this parameter, the system selects a default time zone based on the region where you create the instance. For more information about the mappings between regions and default named time zones, see Mappings between regions and default named time zones for ApsaraDB RDS for PostgreSQL instances.
SLR Authorization
If this is the first time you create an ApsaraDB RDS for PostgreSQL instance after October 10, 2022, you must authorize the service-linked roles (SLRs) AliyunServiceRoleForRdsPgsqlOnEcs and AliyunServiceRoleForRDSProxyOnEcs. This allows the ApsaraDB RDS service to use these roles to attach elastic network interfaces (ENIs) and establish network links.
NoteFor more information about how to authorize an SLR, see Service-linked roles.
Authorization is required only for the first use. You do not need to grant authorization again for subsequent purchases.
This authorization does not incur fees.
For more information about SLR authorization, see [Notice] SLR authorization is required to create ApsaraDB RDS for PostgreSQL instances from October 10, 2022.
Instance Description
A custom description for the instance. The description must be 2 to 255 characters in length. It must start with a letter or a Chinese character and can contain digits, underscores (_), and hyphens (-).
Privileged Account
You can select Configure Now and set the Database Account and Password to create a privileged account at the same time you create the instance. You can also click Configure Later to create the privileged account after the instance is created.
For more information about privileged accounts, see Create an account.
Click Next: Confirm Order.
Confirm the Parameter Configuration and Quantity, select Terms of Service, and click Pay Now to complete the payment.
View the instance.
Go to the Instances page. Select the region of the instance from the top navigation bar. Find the instance that you just created by its Creation Time.
NoteIf the instance fails to be created, the resources in the zone may be insufficient. Try to create the instance in another zone.
What to do next
FAQ
Why can't I see the instance that is being created in the instance list?
Possible cause | Description | Suggestion |
Incorrect region | The region you are viewing is not the region where you created the instance. | Switch to the correct region in the upper-left corner of the page. |
Insufficient resources in the zone | The instance failed to be created because of insufficient resources in the zone. If the instance fails to be created, you can view the refund on the Orders page. | Select a different zone and retry. |
References
To change the RCU scaling range for a serverless ApsaraDB RDS for PostgreSQL instance, see Change the scaling range of RCUs.
To configure the automatic start and stop feature for an instance, see Configure the automatic start and stop feature.
To change the elastic policy of an instance, see Change the elastic policy of an instance.
To release a serverless ApsaraDB RDS for PostgreSQL instance, see Release an instance.
To create a serverless ApsaraDB RDS for PostgreSQL instance using the API, see Create an ApsaraDB RDS instance.