×
Community Blog How to Set up and Configure a Sharded Architecture ApsaraDB for MongoDB Instance

How to Set up and Configure a Sharded Architecture ApsaraDB for MongoDB Instance

This article explains how to set up and configure a shared architecture ApsaraDB for MongoDB Instance.

By Kelvin Galabuzi

What Is ApsaraDB for MongoDB?

Alibaba Cloud ApsaraDB for MongoDB is a secure and elastically scalable MongoDB database service. The service is relatively easy-to-setup. In addition, Alibaba Cloud handles most of the database server administration tasks, letting you focus on the core functioning of your applications.

Alibaba Cloud offers a two-month Enterprise free trial to set up a new ApsaraDB for MongoDB.

ApsaraDB for MongoDB Features

  • Flexible Architecture: ApsaraDB for MongoDB supports standalone instances, sharded architecture instances, and replica set architecture instances for MongoDB.
  • Automated Backup and Recovery: ApsaraDB for MongoDB enables the automatic backing up of data at multiple intervals. This ensures business continuity by enabling you to restore your data to the available checkpoints.
  • Anti-DDOS: ApsaraDB for MongoDB is built with Anti-DDOS capabilities to ensure traffic is monitored in real-time to filter legitimate traffic from non-legitimate traffic. This works with IP address whitelisting to provide access only from the allowed locations.
  • Integration with Data Transmission Service: ApsaraDB for MongoDB supports the transmission of data between on-premises databases and cloud databases. The service also supports data synchronization among multiple ApsaraDB for MongoDB instances.
  • Enhanced Operations and Management Capabilities: ApsaraDB for MongoDB provides an easy-to-use monitoring platform to analyze CPU Utilization, IOPS, connections, and disk space. This feature allows you to monitor multiple ApsaraDB for MongoDB instances within a single control plane. Additionally, you can efficiently perform database kernel version management.

What Is a Sharded Architecture for ApsaraDB for MongoDB?

Before discussing the sharding architecture, we need to understand the different database partitioning strategies:

  • Horizontal Partitioning: This is the practice of separating a table's rows into multiple tables, also known as partitions. Each partition has the same schema and columns, and the data held in each partition is different from the data in other partitions.
  • Vertical Partitioning: This is the practice of separating a table's columns into multiple tables. The data in vertical partitions are independent of the other, and each partition has distinct rows and columns.

The sharding database architecture (horizontal partitioning) separates one table's rows into multiple tables. Each partition (table) has the same schema and columns, and the data is independent of the data in other partitions.

Within' the sharding architecture, data is broken down into shards, also known as logical shards, which are separated across multiple nodes, also known as physical shards. This ensures faster and easier scaling of databases and provides data security and integrity.

Alibaba Cloud ApsaraDB for MongoDB Sharded architecture consists of three major components:

  • Mongos: The Mongos route reads and writes to the corresponding shards. You can purchase multiple Mongos for load balancing and failover purposes.
  • Shard: The shard stores the database data, and you can implement multiple shards to scale out the capacity of data storage and concurrent read/write operations.
  • Config Server: The config server stores the metadata for clusters and shards.

Setting up and Configuring a Sharded Architecture ApsaraDB for MongoDB Instance

The following section will cover how to set up and configure a sharded architecture ApsaraDB for MongoDB Instance:

  • Step 1: In the Alibaba Cloud console, access the NoSQL Databases section and then access the ApsaraDB for MongoDB service:

1

  • Step 2: On the ApsaraDB for MongoDB console, select the Sharded Cluster Instances blade and then click Create Instance:

2

  • Step 3: Select your Product type and its billing model, Region, Zone, Protocol type, Database version, and Storage engine:

3

  • Step 4: Select the Storage type, VPC, vSwitch, Mongos specification, and Mongos quantity:

4

  • Step 5: Select the Instance specification, Shard storage, Shard quantity, Config server specification, and Config server storage:

5

  • Step 6: Set the password for the root user and click Buy Now:

6

  • Step 7: Accept the Terms of Service and click Activate Now:

7

  • Step 8: After a few minutes, the new sharded architecture Apsara for MongoDB Instance will appear in the console:

8

  • Step 9: Configure the whitelist to include the Trusted IP Ranges that can access your ApsaraDB for MongoDB:

9

  • Step 10: Add the IP ranges to your new whitelist:

Note: We recommend not adding an IP range of 0.0.0.0/0 on production systems; only enable access from trusted IP ranges.

10

  • Step 11: Click Log On and select the database shard to which you would like to connect:

11

  • Step 12: The Data Management Service will load in a different tab. Select your MongoDB database instance, insert the Database Account name and Password, and click Login:

12

  • Step 13: Finally, you can start working with the ApsaraDB for MongoDB instance using the Alibaba Cloud Data Management Service or any other MongoDB client connectivity tool:

13

0 0 0
Share on

Alibaba Cloud Community

1,042 posts | 256 followers

You may also like

Comments