MongoDB Atlas

MongoDB Atlas is a cloud service by MongoDB. It is built for developers who'd rather spend time building apps than managing databases. This service is available on AWS, Azure, and GCP.

It is the worldwide cloud database service for modern applications that give best-in-class automation and proven practices guarantee availability, scalability, and compliance with the foremost demanding data security and privacy standards. We can use MongoDB's robust ecosystem of drivers, integrations, and tools to create faster and spend less time managing our database.

Advantages of MongoDB Atlas

  • Global clusters for world-class applications: Using MongoDB Atlas, we are free to choose the cloud partner and ecosystem that fit our business strategy.
  • Secure for sensitive data: It offers built-in security controls for all our data. It enables enterprise-grade features to integrate with our existing security protocols and compliance standard.
  • Designed for developer productivity: MongoDB Atlas moves faster with general tools to work with our data and a platform of services that makes it easy to build, secure, and extend applications that run on MongoDB.
  • Reliable for mission-critical workload: It is built with distributed fault tolerance and automated data recovery.
  • Built for optimal performance: It makes it easy to scale our databases in any direction. We can get more out of our existing resources with performance optimization tools and real-time visibility into database metrics.
  • Managed for operational efficiency: It comes with built-in operational best practices, so we can focus on delivering business value and accelerating application development instead of managing databases.

Create an Atlas Account and deploying a Free Tier Cluster

Step 1: Go to https://www.mongodb.com/cloud/atlas to register for an Atlas account to host your data.

MongoDB Atlas

Step 2: When you click on Start Free, you will be redirected to the Registration form for an account on the MongoDB Atlas.

MongoDB Atlas

Step 3: Select Starter Clusters and click create a Cluster. The Starter cluster includes the M0, M2, and M5 cluster tiers. These low-cost clusters are suitable for users who are learning MongoDB or developing small proof -of- concept applications.

MongoDB Atlas

Step 4: Select your preferred Cloud Provider & Region. It supports M0 Free Tier clusters on Amazon Web Services (AWS), Google Cloud Platform (GCP), and Microsoft Azure. The regions that support M0 Free tier clusters are marked with the "Free Tier Available" label.

MongoDB Atlas

Step 5: Select M0 Sandbox for cluster tier: Selecting M0 automatically locks the remaining configuration options. If you can't select the M0 cluster tier, return to the previous step and choose a Cloud Provider & Region that supports M0 Free Tier clusters.

MongoDB Atlas

Step 6: Enter a name for your cluster in the Cluster Name field; you can enter any name for your cluster. The cluster name contains ASCII letters, numbers, and hyphens.

MongoDB Atlas

Step 7: Click on Create Cluster to deploy the cluster. Once you deploy your cluster, it can take up to 5-10 min for your cluster to provision and become ready to use.

MongoDB Atlas

Step 8: Once we register, Atlas automatically creates a default organization and project where we can deploy our first cluster. We can add additional organizations and projects later.

MongoDB Atlas

How to Whitelist your Connection IP Address

An IP address is a unique numeric identifier for a device connecting to a network. In Atlas, we can only connect to a cluster from a trusted IP address. Within Atlas, we can create an inventory of trusted IP addresses, mentioned as a Whitelist, which may be used to connect to our cluster and access our data.

We must add our IP address to the whitelist before we can connect to our cluster — the following steps we should take to whitelist our connection IP address.

Step 1: First, click on the Connect button from our cluster view.

MongoDB Atlas

Step 2: Configure your Whitelist entry. In the Whitelist your connection IP address step, click Add our Current IP Address.

MongoDB Atlas

Step 3: Click Add IP Address.

MongoDB Atlas

Creating a MongoDB User for our Cluster

For security purposes, Atlas requires clients to authenticate as MongoDB users to access the cluster. We must create a MongoDB user to access our cluster. MongoDB users are separate from Atlas users:

  • MongoDB users can access a database hosted in Atlas.
  • Atlas users can log into Atlas but do not have access to MongoDB databases.

Step 1: Open the Connect dialogue from our Cluster view.

MongoDB Atlas

Step 2: In the Create a MongoDB User step of the dialog, enter a Username and a password for our MongoDB user.

MongoDB Atlas

Step 3: Finally, click on Create MongoDB User button.

MongoDB Atlas

Connecting to Cluster

We can connect to our cluster in several ways. We will see how we can connect our cluster using the mongo shell driver.

Following are the steps to download and install the mongo shell driver.

Step 1: Open the Connect dialog from your cluster.

MongoDB Atlas

Step 2: Click connect with the Mongo Shell.

Step 3: Click on "I do not have the Mongo Shell installed" and select your operating system from the dropdown.

MongoDB Atlas

Step 4: Click on download the Mongo Shell.

Step 5: To run a Mongo Shell from your PC, you will need to add the Shell to your system path.

MongoDB Atlas

MongoDB Atlas

Step 6: To see if you have correctly added the Mongo Shell to your system-path, run the following command in your terminal.

Connect to your Atlas Cluster

Step 7: Click on "I have the Mongo Shell Installed" and select your Mongo Shell version from the drop-down menu.

MongoDB Atlas

Step 9: Now, copy the provided connection string to your clipboard, then paste and run your connection string in your terminal.

MongoDB Atlas

Step 10: Now, you will be prompted to enter the password you specified when you created your MongoDB user in Atlas.

MongoDB Atlas

You are now will be connected to your Atlas cluster within the Mongo Shell.






Latest Courses