This topic describes how to create and connect to a DuckDB-based analytical primary instance in the ApsaraDB RDS console.
Permissions required
If you use a RAM user to create the instance, ensure that the AliyunRDSFullAccess and AliyunBSSOrderAccess policies are attached to the RAM user. For more information, see Authorize RAM resources.
Create a DuckDB-based analytical primary instance
Select a Billing Method. The following billing methods are supported:
Pay-as-you-go: This billing method is suitable for short-term use or for trying out ApsaraDB RDS instances. You can release the instance at any time to stop billing. This topic uses this method as an example.
Subscription: This billing method is suitable for long-term use and is more cost-effective than pay-as-you-go.
Select a Region.
ImportantYou cannot change the region of an ApsaraDB RDS instance after it is created. Select the region carefully.
If you have an Elastic Compute Service (ECS) instance and want it to communicate with the ApsaraDB RDS instance over an internal network, select the same region for both instances. Otherwise, the ECS instance can access the ApsaraDB RDS instance only over the internet, which can negatively affect performance.
To connect to the ApsaraDB RDS instance from a physical device, such as a local server or computer, other than an ECS instance, select a region that is geographically close to the device and connect to the ApsaraDB RDS instance using its public endpoint. This reduces network latency.
Configure Database Engine, Edition, Product Type, and Storage Type.
Set Database Engine to MySQL_DuckDB and the version to 8.0.
Select an Edition. Cluster Edition are supported.
Select a Product Type. Only Standard is supported.
Select a Storage Type. Only Premium ESSD is supported.
(Optional) You can enable disk encryption.
Configure the instance network. The Network Type parameter is automatically set to VPC.
Select a VPC.
You cannot change the VPC after the instance is created. To connect to the ApsaraDB RDS instance from an ECS instance over an internal network, select the same VPC as the ECS instance.
Specify whether to add the VPC CIDR block to the Whitelist.
We recommend that you add the CIDR block of the VPC to the whitelist of the ApsaraDB RDS instance. Otherwise, you must manually set the IP address whitelist after you create the instance.
Select zones and vSwitches, the number of secondary nodes, and a deployment method.
Select a zone and vSwitch
A zone is an independent physical area within a region.
There are no functional differences between zones in the same region. An ECS instance has better performance when accessing an RDS instance in the same zone than in a different zone, but the difference is minimal.
A vSwitch is a basic network device within a VPC that connects different cloud resources. When you create a cloud resource in a VPC, you must specify the vSwitch for that resource.
You can select an existing vSwitch or click Create vSwitch to create a new one. For more information about the parameters, see Create and manage a vSwitch.
Select the number of secondary nodes
To ensure high availability, you must configure at least one secondary node. You can configure one or two secondary nodes when you create the instance. After the instance is created, you can add nodes to scale out to a maximum of eight secondary nodes.
Select a deployment method
Multi-zone Deployment (Recommended): The primary and secondary nodes are located in different zones within the same region. This provides cross-zone disaster recovery.
If you select Multi-zone Deployment, you must configure Primary Zone and Network and Secondary Zone and Network.
Single-zone Deployment: The primary and secondary nodes are located in the same zone.
Select an Instance Type.
Select a Category. Currently, only Dedicated instance types with dedicated CPU, memory, storage, and I/O resources are supported.
Select a specific instance type based on the number of CPU cores and memory. For a list of instance types, see DuckDB-based analytical primary instance types.
ImportantFor Cluster Edition instances, the reference price displayed in the Instance Type section is the price for a single node. For example, if you purchase a Cluster Edition instance with one primary node and two secondary nodes, the total price of the instance is three times the reference price. You can hover over Configure Fee next to View Details in the lower-right corner to view the details.
Select a Storage Capacity.
The storage capacity ranges from 20 GB to 128,000 GB with a minimum step size of 5 GB.
NoteYou can enable Automatic Storage Expansion and set the trigger conditions and the upper limit for automatic expansion. When triggered, the system automatically expands the storage by 5 GB or 15% of the current storage capacity, whichever is larger. This feature prevents the instance from being locked due to insufficient storage space.
(Optional) Configure additional custom parameters. If you do not have special requirements, we recommend that you use the default values.
Parameter
Description
Database Port
You can initialize the port when creating the instance. The value can range from 1000 to 65534.
Default Storage Engine
Only DuckDB is supported.
Time Zone
Set the time zone for the instance.
Table Name Case Sensitivity
The default is Case-insensitive. If your local database is case-sensitive, select Case-sensitive to simplify data migration.
Release Protection
Select this parameter to enable instance release protection for pay-as-you-go instances. This prevents accidental release of pay-as-you-go instances. For more information, see Enable or disable instance release protection.
Minor Engine Version Update Policy
Set the minor engine version update policy:
Auto Upgrade (Recommended): The instance is automatically upgraded to the latest minor version within the maintenance window. You can change the upgrade time on the Scheduled Events page.
Manual Upgrade: Manually upgrade the instance on its Basic Information page.
NoteIf you do not want to use the latest minor version, select Select Minor Engine Version to specify a minor version.
Resource Group
Select a default or custom resource group to facilitate instance management.
Instance Name
Enter a description for the instance to make it easy to identify.
Tags
If you have many instances, you can attach tags to them for classification and management. For more information, see Filter instances by tag.
Privileged Account
Select Configure Now, enter an account and password to create a privileged account. Or select Configure Later to create a privileged account later. For more information about privileged accounts, see Create a privileged account.
Confirm the order information, quantity, and subscription duration (for subscription instances only). Then, click Confirm Order and complete the payment.
NoteFor subscription instances, different subscription durations correspond to different discounts. You can hover over Configure Fee next to View Details in the lower-right corner to view the fee details.
For subscription instances, we recommend that you select Enable Auto-renewal to prevent business interruptions that are caused by an expired instance. If you purchase by month, the auto-renewal cycle is one month. If you purchase by year, the auto-renewal cycle is one year. The actual cycle depends on your order. You can cancel auto-renewal at any time. For more information, see Auto-renewal.
View the instance.
Go to the Instances page. In the top navigation bar, select the region where the instance is located. Find the newly created instance based on its Creation Time.
NoteInstance creation takes about 1 to 10 minutes. Refresh the page to view the status.
Create a database account
For more information, see Create a database account.
Connect to a DuckDB-based analytical primary instance
Direct connection
Go to the ApsaraDB RDS Instances page, select the region of the instance in the top navigation bar, and then click the ID of the target instance.
On the page, click View Connection Details. In the pop-up window that appears, view and copy the internal or public endpoint of the DuckDB-based analytical primary instance.
The method for connecting to a DuckDB-based analytical primary instance is the same as the method for connecting to an ApsaraDB RDS for MySQL instance. For more information, see the following topics: