ApsaraDB for MongoDB supports three instance architectures. Choose the architecture that fits your workload, then follow the steps in the corresponding section to create an instance.
Choose an architecture
| Architecture | Best for | Key constraints |
|---|---|---|
| Replica set (recommended) | Most production workloads | High availability with automatic failover. Supports read-only nodes for read scaling. |
| Sharded cluster | Large datasets or high-throughput workloads that exceed a single node's capacity | Distributes data across multiple shards. Requires configuring mongos, shards, and ConfigServer components. |
| Standalone | Development, testing, or lightweight non-critical workloads | Single node, no failover. Limited to MongoDB 4.0 and ESSD PL1 storage. Not suitable for production. |
Prerequisites
Before you begin, ensure that you have:
Billing
Charges are based on instance specifications and storage. For details, see Billable items.
Free trial: Enterprise users creating their first ApsaraDB for MongoDB instance can apply for a free trial for replica set instances on the All Free Tier Products Available page.
Create a replica set instance
The following steps show how to create a pay-as-you-go MongoDB 8.0 replica set instance. For the full parameter reference, see Create a replica set instance.
Go to the ApsaraDB for MongoDB buy page.
Configure the following parameters. The following parameters are fixed and cannot be changed:
ImportantThe example password is for demonstration only. Do not use it in production.
Required parameters
Parameter Description Example Product type Select the instance architecture. Replica Set (pay-as-you-go) Region Select the region where the instance is deployed. Choose the region closest to your application to reduce latency. China (Hangzhou) Deployment type/Zone type Select the deployment type. Single-zone Zone Select the zone within the region. Hangzhou Zone J Engine version Select a MongoDB version. MongoDB 8.0 Active-standby nodes Select the number of nodes in the replica set. Three Nodes Replicaset Storage type Select the storage type. ESSD PL1 Category Select the specification category. Dedicated Specifications Select the instance specifications, which determine CPU and memory. 2 Cores, 8 GB (Dedicated) Storage Select the storage capacity. 20 GB Set password Select Set Now to configure the password immediately. If you select Set Later, reset the password before connecting to the instance. Set Now Password Enter and confirm the password for the root account. PassWord123! Optional parameters
Parameter Description Default Read-only nodes Number of read-only nodes for read scaling. No Read-only Node Encryption type Whether to enable disk encryption. No Encryption VPC Virtual private cloud (VPC) for the instance. For private network access, select the same VPC as your ECS instance. Use the Default VPC, or select an existing one in the VPC console. Default VPC vSwitch vSwitch for the instance. Use the Default Switch, or select an existing one in the VPC console. Default vSwitch Resource group Resource group for organizing the instance. Default Resource Group Tag Tags to attach to the instance. None Instance name Custom name for the instance. Test instance Quantity Number of instances to create with this configuration. 1 Parameter Fixed value Storage engine Wired Tiger Network type VPC Username root Click Buy Now.
Confirm the Parameters and click Activate Now.
On the Activated page, click Console to go to the Instances page. The new instance appears in the list.
Instance creation takes 10–15 minutes. If the instance is not listed, refresh the page.
Create a sharded cluster instance
The following steps show how to create a pay-as-you-go MongoDB 8.0 sharded cluster instance. For the full parameter reference, see Create a sharded cluster instance.
Go to the ApsaraDB for MongoDB buy page.
Configure the following parameters. The following parameters are fixed and cannot be changed:
ImportantThe example password is for demonstration only. Do not use it in production.
Required parameters
Parameter Description Example Product type Select the instance architecture. Sharded Cluster (pay-as-you-go) Region Select the region where the instance is deployed. China (Hangzhou) Zone type Select the deployment type. Single-zone Zone Select the zone within the region. Hangzhou Zone J Engine version Select a MongoDB version. MongoDB 8.0 Storage type Select the storage type. ESSD PL1 Category Select the specification category. Dedicated Mongos specification Select the specifications for the mongos routing components. 2 Cores, 8 GB (Dedicated) Mongos quantity Select the number of mongos components. 2 Shard specifications Select the specifications for the shard components. 2 Cores, 8 GB (Dedicated) Shard storage Select the storage capacity of each shard. 20 GB Shard quantity Select the number of shard components. 2 ConfigServer specification Select the specifications for the ConfigServer components. 4 Cores, 8 GB (Dedicated) ConfigServer storage Select the storage capacity of the ConfigServer component. 20 GB Set password Select Set Now to configure the password immediately. If you select Set Later, reset the password before connecting to the instance. Set Now Password Enter and confirm the password for the root account. PassWord123! Optional parameters
Parameter Description Default Shard read-only nodes Number of read-only nodes per shard. No Read-only Node Encryption type Whether to enable disk encryption. No Encryption VPC VPC for the instance. For private network access, select the same VPC as your ECS instance. Use the Default VPC, or select an existing one in the VPC console. Default VPC vSwitch vSwitch for the instance. Use the Default Switch, or select an existing one in the VPC console. Default vSwitch Resource group Resource group for organizing the instance. Default Resource Group Tag Tags to attach to the instance. None Instance name Custom name for the instance. Test instance Parameter Fixed value Protocol type MongoDB Storage engine Wired Tiger Network type VPC Username root Click Buy Now.
Confirm the Parameters and click Activate Now.
On the Activated page, click Console to go to the Instances page. The new instance appears in the list.
Instance creation takes 10–15 minutes. If the instance is not listed, refresh the page.
Create a standalone instance
Standalone instances are limited to MongoDB 4.0 and ESSD PL1 storage. For production workloads, use a replica set instance instead.
The following steps show how to create a pay-as-you-go MongoDB 4.0 standalone instance. For the full parameter reference, see Create a standalone instance.
Go to the ApsaraDB for MongoDB buy page.
Configure the following parameters. The following parameters are fixed and cannot be changed:
ImportantThe example password is for demonstration only. Do not use it in production.
Required parameters
Parameter Description Example Product type Select Replica Set (pay-as-you-go). You configure a standalone node in the next field. Replica Set (pay-as-you-go) Region Select the region where the instance is deployed. China (Hangzhou) Deployment type/Zone type Select the deployment type. Single-zone Zone Select the zone within the region. Hangzhou Zone G Active-standby nodes Select Standalone. Standalone Specifications Select the instance specifications, which determine CPU and memory. 4 Cores, 8 GB (General) Storage Select the storage capacity. 20 GB Set password Select Set Now to configure the password immediately. If you select Set Later, reset the password before connecting to the instance. Set Now Password Enter and confirm the password for the root account. PassWord123! Optional parameters
Parameter Description Default VPC VPC for the instance. For private network access, select the same VPC as your ECS instance. Use the Default VPC, or select an existing one in the VPC console. Default VPC vSwitch vSwitch for the instance. Use the Default Switch, or select an existing one in the VPC console. Default vSwitch Resource group Resource group for organizing the instance. Default Resource Group Tag Tags to attach to the instance. None Instance name Custom name for the instance. Test instance Quantity Number of instances to create with this configuration. 1 Parameter Fixed value Engine version MongoDB 4.0 Read-only nodes No Read-only Node Storage engine Wired Tiger Storage type ESSD PL1 Category General-purpose Network type VPC Username root Click Buy Now.
Confirm the Parameters and click Activate Now.
On the Activated page, click Console to go to the Instances page. The new instance appears in the list.
Instance creation takes 10–15 minutes. If the instance is not listed, refresh the page.