Step 1: Create a DB Instance
Scenarios
This section describes how to buy a DB instance on the RDS console.
RDS allows you to tailor your compute resources and storage space to your business needs.
Procedure
- Log in to the management console.
- Click
in the upper left corner and select a region and a project.
- Click Service List. Under Database, click Relational Database Service.
- On the Instances page, click Create DB Instance.
- On that page, configure information about your DB instance. Then, click Create Now.
- Basic information
Table 1 Basic information Parameter
Description
Region
Region where your resources are located.
NOTE:Products in different regions cannot communicate with each other through a private network. After a DB instance is created, the region cannot be changed. Therefore, exercise caution when selecting a region.
DB Instance Name
Different DB instances can have the same name. The instance name must start with a letter and consist of 4 to 64 characters. Only letters (case-sensitive), digits, hyphens (-), and underscores (_) are allowed.
DB Engine
Set to PostgreSQL.
DB Engine Version
For details, see DB Engines and Versions.
Different DB engine versions are supported in different regions.
You are advised to select the latest available version because it is more stable, reliable, and secure.
DB Instance Type
- Primary/Standby: uses an HA architecture with a primary DB instance and a synchronous standby DB instance. It is suitable for production databases of large and medium enterprises in Internet, Internet of Things (IoT), retail e-commerce sales, logistics, gaming, and other sectors. The standby DB instance improves instance reliability and is invisible to you after being created.
An AZ is a physical region where resources use independent power supply and networks. AZs are physically isolated but interconnected through an internal network.
You can deploy primary and standby DB instances in a single AZ or across AZs to achieve failover and high availability.
- Single: uses a single-node architecture, which is less expensive than primary/standby DB instances. It is suitable for development and testing of microsites, and small- and medium-sized enterprises, or for learning about RDS.
Storage Type
Determines the DB instance read/write speed. The higher the maximum throughput is, the higher the DB instance read/write speed can be.
- Cloud SSD: cloud drives used to decouple storage from compute.
- Extreme SSD: uses 25GE network and RDMA technologies to provide you with up to 1,000 MB/s throughput per disk and sub-millisecond latency.
Time Zone
You need to select a time zone for your instance based on the region hosting your instance. You can select a time zone during instance creation and change it later as needed.
- Primary/Standby: uses an HA architecture with a primary DB instance and a synchronous standby DB instance. It is suitable for production databases of large and medium enterprises in Internet, Internet of Things (IoT), retail e-commerce sales, logistics, gaming, and other sectors. The standby DB instance improves instance reliability and is invisible to you after being created.
- DB instance specifications
Table 2 Instance specifications Parameter
Description
Instance Class
Refers to the vCPU and memory of a DB instance. Different instance classes support different numbers of database connections and maximum IOPS.
For details about instance classes, see RDS for PostgreSQL Instance Classes.
After a DB instance is created, you can change its vCPU and memory. For details, see Changing a DB Instance Class.
Storage Space (GB)
Contains the system overhead required for inodes, reserved blocks, and database operation. Storage space can range in size from 40 GB to 4,000 GB and can be scaled up only by a multiple of 10 GB.
After a DB instance is created, you can scale up its storage space. For details, see Scaling Storage Space.
Disk Encryption
- Disable: indicates the encryption function is disabled.
- Enable: indicates the encryption function is enabled, improving data security but affecting system performance.
If you select Enable, Key Name indicating the tenant key needs to be specified.
NOTE:- After an instance is created, the disk encryption status and the key cannot be changed. The backup data stored in OBS is not encrypted.
- After an instance is created, do not disable or delete the key that is being used. Otherwise, the database will be unavailable and data cannot be restored.
- For details about how to create a key, see the "Creating a CMK" section in the Data Encryption Workshop User Guide.
- Network and database configuration
Table 3 Network Parameter
Description
VPC
A virtual network in which your RDS DB instances are located. A VPC can isolate networks for different workloads. You can select an existing VPC or create a VPC. For details about how to create a VPC, see "Creating a VPC" in Virtual Private Cloud User Guide.
If no VPC is available, RDS allocates a VPC to you by default.
NOTICE:After a DB instance is created, the VPC cannot be changed.
Subnet
Improves network security by providing dedicated network resources that are logically isolated from other networks. Subnets take effect only within an AZ. The Dynamic Host Configuration Protocol (DHCP) function is enabled by default for subnets in which you plan to create RDS DB instances and cannot be disabled.
- IPv4 address:
A floating IPv4 address is automatically assigned when you create a DB instance. You can also enter an unused floating IPv4 address in the subnet CIDR block. After the DB instance is created, you can change the floating IP address.
Security Group
Controls the access that traffic has in and out of a DB instance. By default, the security group associated with the DB instance is authorized.
Enhances security by controlling access to RDS from other services. You need to add inbound rules to a security group so that you can connect to your DB instance.
If no security group is available, RDS allocates a security group to you by default.
Database Port
The default database port is 5432. You can change it after a DB instance is created.
Table 4 Database configuration Parameter
Description
Administrator
The default login name for the database is root.
Administrator Password
Must consist of 8 to 32 characters and contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters (~ ! @ # $ % ^ * - _ = + ? ,). Enter a strong password and periodically change it for security reasons.
If the password you provide is regarded as a weak password by the system, you will be prompted to enter a stronger password.
Keep this password secure. The system cannot retrieve it.
After a DB instance is created, you can reset this password. For details, see Resetting the Administrator Password.
Confirm Password
Must be the same as Administrator Password.
Parameter Template
Contains engine configuration values that can be applied to one or more DB instances. If you intend to create primary/standby DB instances, they use the same parameter template.
NOTICE:If you use a custom parameter template when creating a DB instance, the following specification-related parameters in the custom template are not delivered. Instead, the default values are used.
- maintenance_work_mem
- shared_buffers
- max_connections
- effective_cache_size
You can modify the instance parameters as required after the DB instance is created. For details, see Modifying Parameters of an RDS for PostgreSQL Instance.
Enterprise Project
If your account has been associated with an enterprise project, select the target project from the Enterprise Project drop-down list.
- IPv4 address:
- Tags
Table 5 Tags Parameter
Description
Tag
Tags an RDS DB instance. This parameter is optional. Adding tags to RDS DB instances helps you better identify and manage the DB instances. A maximum of 20 tags can be added for each DB instance.
After a DB instance is created, you can view its tag details on the Tags page. For details, see RDS for PostgreSQL Tags.
- Batch creation
Table 6 Batch creation Parameter
Description
Quantity
RDS supports DB instance creation in batches. If you choose to create primary/standby DB instances and set Quantity to 1, a primary DB instance and a standby DB instance will be created synchronously.
If you create multiple DB instances at a time, they will be named with four digits appended to the DB instance name. For example, if you enter instance, the first instance will be named instance-0001, the second instance-0002, and so on.
NoteThe performance of your DB instance depends on its configurations. Hardware configuration items include the instance specifications, storage type, and storage space.
- Basic information
- Confirm the specifications.
- If you need to modify your settings, click Previous.
- If you do not need to modify your settings, click Submit.
- To view and manage your DB instance, go to the Instances page.
- When your DB instance is being created, the status is Creating. The status changes to Available after the instance is created.
- The automated backup policy is enabled by default. You can change it after the DB instance is created. An automated full backup is immediately triggered once your DB instance is created.
- The default database port is 5432. You can change it after a DB instance is created.
For details, see Changing a Database Port.
- Scenarios
- Procedure