All Products
Search
Document Center

ApsaraDB for MongoDB:Create a DynamoDB-compatible ApsaraDB for MongoDB instance

Last Updated:Apr 28, 2024

Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. Sharded cluster instances are compatible with the DynamoDB protocol. This topic describes how to create a DynamoDB-compatible sharded cluster instance.

Important

DynamoDB-compatible sharded cluster instances are no longer available for purchase. To use sharded cluster instances, we recommend that you use the MongoDB protocol. For more information, see [Notice] End of sale for DynamoDB-compatible sharded cluster instances.

Prerequisites

  • An Alibaba Cloud account is created. For more information, see Sign up with Alibaba Cloud.

  • If you want to create a pay-as-you-go instance, make sure that your account has sufficient balance.

Usage notes

  • Only sharded cluster instances that run MongoDB 4.0 are compatible with the DynamoDB protocol.

  • If your application is deployed on an Elastic Compute Service (ECS) instance, make sure that your ApsaraDB for MongoDB instance and ECS instance meet the following requirements to ensure network connectivity. For more information about how to view the information of ECS instances, see View instance information.

    • Your ApsaraDB for MongoDB instance and ECS instance are deployed in the same region.

    • Your ApsaraDB for MongoDB instance and ECS instance use the same network type.

      Note
      • The same zone is recommended because the same zone reduces network latency.

      • VPC is recommended because VPC provides higher security.

      • If the network type is VPC, you must ensure that they use the same VPC ID.

      • If you want to use VPC, but the network type of the ECS instance is classic network, you can change the network type of the ECS instance to VPC. For more information, see Migrate ECS instances from the classic network to a VPC.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.

  2. In the left-side navigation pane, click Sharded Cluster Instances.

  3. On the Sharded Cluster Instances page, click Create Instance.

  4. On the page that appears, set the Product Type parameter to Sharded Cluster (Subscription) or Sharded Cluster (Pay-as-you-go).

  5. Configure the parameters described in the following table.

    Parameter

    Description

    Region

    The region where you want to deploy the instance.

    Note
    • After the instance is created, the region of the instance cannot be changed. Select the region with caution.

    • If your application is deployed on an ECS instance, we recommend that you deploy the instance in the region where the ECS instance resides. If the instance and the ECS instance reside in different regions, your application cannot communicate with the instance over an internal network.

    Zone

    The zone where you want to deploy the instance.

    Note
    • If your application is deployed on an ECS instance, we recommend that you make sure that the instance and the ECS instance belong to the same zone. This reduces network latency. If the zone that you select for the sharded cluster instance is different from the zone of the ECS instance, you can migrate the sharded cluster instance to the same zone as the ECS instance after the sharded cluster instance is created. For more information, see Migrate an ApsaraDB for MongoDB instance to a different zone.

    • You can select the multi-zone deployment for zone-disaster recovery. For more information, see Create a multi-zone sharded cluster instance.

    Protocol Type

    The protocol type of the instance. Select DynamoDB.

    Note

    For more information about the DynamoDB protocol, see Compatibility details of DynamoDB-compatible ApsaraDB for MongoDB instances.

    Engine Version

    The engine version of the instance. Select MongoDB 4.0.

    Storage Engine

    The storage engine of the instance. Set the value to WiredTiger.

    Network Type

    The network type of the instance. Select VPC.

    Note
    • A virtual private cloud (VPC) is an isolated virtual network that provides higher security and performance than the classic network.

    • If your application is deployed on an ECS instance, you must make sure that the ECS instance resides in a VPC. This ensures network connectivity between your application and the instance.

    VPC

    The ID of the VPC where you want to deploy the instance. If no VPCs are available, you can create a VPC in the VPC console. For more information, see Create and manage a VPC.

    Note

    vSwitch

    The ID of the vSwitch to which the instance connects. If no vSwitches are available, you can create a vSwitch in the VPC console. For more information, see Create and manage a vSwitch.

    Mongos Specification

    The specifications of the mongos node in the instance. For more information about specifications supported by mongos nodes, see Overview.

    Note

    When the instance is in the Running state, you can change the configurations and quantity of mongos nodes.

    Mongos Quantity

    The number of mongos nodes in the instance. Valid values: 2 to 32.

    Note
    • By default, mongos nodes use the standalone architecture. We recommend that you select two or more mongos nodes to ensure high availability.

    • A maximum of 32 mongos nodes can be added to each sharded cluster instance.

    Shard Specifications

    The specifications of the shard node in the instance. For more information about specifications supported by shard nodes, see Overview.

    Note

    When the instance is in the Running state, you can change the configurations and quantity of shard nodes.

    Shard Storage

    The storage capacity of each shard node in the instance.

    Note
    • This parameter specifies the storage capacity of each node, rather than the sum of the storage capacity of all nodes.

    • The storage capacity is used to store the data, system, and log files.

    Shard Read-only Nodes

    The number of read-only nodes in the instance. This parameter is displayed only when the sharded cluster instance is billed on a subscription basis. For more information about read-only nodes, see Read-only nodes.

    Shard Quantity

    The number of shard nodes in the instance. Valid values: 2 to 32.

    Note
    • By default, shard nodes use the three-node replica set architecture. We recommend that you specify two or more shard nodes to ensure proper sharding configurations. This way, the storage space and computing performance of shard nodes can be fully utilized. For more information, see Configure sharding to maximize the performance of shards.

    • A maximum of 32 shard nodes can be added to each sharded cluster instance.

    ConfigServer Specification

    The specifications of the ConfigServer node in the instance. This value can be fixed only to 1 core and 2 GB memory.

    ConfigServer Storage

    The storage capacity of the ConfigServer node in the instance. This value can be fixed only to 20 GB.

    Set Password

    The time at which you want to set the password of the root user. Valid values:

    • Set Now: You want to immediately set the password of the root user.

    • Set Later: You want to set the password of the root user after the instance is created. For more information, see (Optional) Reset a password.

    Password

    The password of the root user. If you set the Set Password parameter to Set Now, you must set the password of the root user when you create the instance. You must set the password in compliance with the following rules:

    • The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and specific special characters. The following special characters are supported:

      !@#$%^&*()_+-=

    • The password must be 8 to 32 characters in length.

    Duration

    The subscription duration of the instance. This parameter is displayed only when you specify to create a subscription instance. A valid monthly subscription duration ranges from one month to nine months. A valid yearly subscription duration ranges from one year to five years.

    Note

    If you want to enable auto-renewal for the instance, select Auto-renewal and make sure that you have sufficient balance within your account.

  6. Pay for the sharded cluster instance based on the billing method of the instance.

    Billing method

    Operation

    Subscription

    1. After you complete the parameter settings, click Buy Now.

    2. On the Confirm Order page, check the parameter settings. Then, read MongoDB Replica Set (Subscription) Agreement of Service and select I have read and agree to MongoDB Replica Set (Subscription) Agreement of Service.

    3. Click Pay. On the Purchase page, complete the payment.

    Note

    You can also click Add to Cart to pay for orders in the cart in a lump sum. For more information, see the "Pay for orders in the cart" section in the Create a standalone instance topic.

    Pay-as-you-go

    1. After you complete the parameter settings, click Buy Now.

    2. On the Confirm Order page, check the parameter settings. Then, read MongoDB Replica Set (Pay-as-you-go) Agreement of Service and select I have read and agree to MongoDB Replica Set (Pay-as-you-go) Agreement of Service.

    3. Click Activate Now.The system collects the amount due within the next hour.

  7. Check whether the sharded cluster instance has been created.

    1. After you complete the payment, click Console to go to the ApsaraDB for MongoDB console.

    2. In the upper-left corner of the page that appears, select the resource group and region to which the desired instance belongs.

    3. In the left-side navigation pane, click Sharded Cluster Instances.

    4. Check whether the created instance is in the sharded cluster instance list.

      • If the instance is displayed, the instance is created. If the instance is in the Running state, the instance is running as expected.

      • If the instance is not displayed, wait for 10 minutes to 15 minutes. Then, refresh the page. If the instance is still not displayed, check whether the issues that are described in the following table occur. If none of the issues occur, contact Alibaba Cloud technical support.

        The following table describes the possible causes of and solutions to the issues due to which the created instance is not displayed.

        Possible cause

        Solutions

        The instance does not belong to the region that you select.

        In the upper-left corner of the ApsaraDB for MongoDB console, select the resource group and region to which the instance belongs.

        The instance does not belong to the instance architecture that you select.

        In the left-side navigation pane of the ApsaraDB for MongoDB console, click Sharded Cluster Instances.

        The sharded cluster instance is not created due to insufficient resources.

        The system may fail to create the sharded cluster instance due to insufficient resources. In this case, your payment is refunded.

        After you confirm that the payment is refunded, you can try to create an instance in another zone.

Pay for the orders in the cart

If you want to purchase a subscription instance, you can also click Add to Cart to pay for orders in the cart in a lump sum after you complete the parameter settings. You can perform the following steps to pay for orders in the cart:

  1. In the lower-right corner of the page, click the Cart icon.

  2. In the Cart panel, select the orders for which you want to pay and click Proceed to Checkout.

  3. On the Cart page, check whether the products that you want to buy are selected.

    Note

    You can also re-specify the Subscription Cycle and Quantity parameters.

    • Yes: Click Buy Now.

    • If the orders that you want to pay are not selected, select the orders and click Buy Now.

  4. On the Confirm Order page, read ApsaraDB for MongoDB (Subscription) Service Agreement, select I have read and agreed to the terms, and then click Confirm Purchase.

  5. On the Purchase page, complete the payment.

Related API operations

Operation

Description

CreateShardingDBInstance

  • Creates an ApsaraDB for MongoDB sharded cluster instance.

  • Clones an ApsaraDB for MongoDB sharded cluster instance.

DescribeInstanceAutoRenewalAttribute

Queries whether auto-renewal is enabled for an ApsaraDB for MongoDB instance.

DescribeDBInstanceAttribute

Queries the detailed information of an ApsaraDB for MongoDB instance.

What to do next

After the sharded cluster instance is created, perform the following operations: