Mongodb Atlas Setting Up Using Managed Mongodb
Mongodb Atlas Setting Up Using Managed Mongodb
In this article, I’ll show you how to set up a NoSQL cloud database using MongoDB Atlas.
The MongoDB Atlas free tiers provide developers a turnkey solution to prototype and test
applications using MongoDB as the backend database. Database as a service (DBaaS) aims to
eliminate the tedious configuration process of a database while providing a scalable, highly
available, and high-performance database.
Let’s take a look.
(This article is part of our MongoDB Guide. Use the right-hand menu to navigate.)
Infrastructure provisioning
Database configurations
Patches
Scaling
Backups
Features of MongoDB Atlas
Key features of Atlas include:
Cloud provider agnostic. MongoDB Atlas is a cloud provider agnostic service that allows users
to run the database service on a cloud provider of their choice, including, of course, AWS,
Azure, and GCP.
Up-to-date features. MongoDB Atlas provides support to the two latest versions of MongoDB
service with automatic patching and one-click upgrades.
Scalability & high availability. Atlas can scale out and scale up to meet the database’s needs
effortlessly while having a minimum of three data nodes per replica set deployed across
availability zones, providing continuous database functionality.
High performance. The MongoDB WiredTiger storage engine, along with compression and
fine-grained concurrency control, gives the required performance for any database need.
Additionally, Atlas provides monitoring and alerts, strong security, workload isolation, and disaster
recovery functions.
You can use your pre-existing Google account to log in to the service.
You can use your email to create a new account by providing an email address, name,
password, and company name.
Review and accept the Terms of Service and Privacy Policy before clicking Sign Up. In this tutorial,
we will use an email to create a MongoDB Atlas account.
MongoDB Atlas website
Cloud provider
Region
Cluster tier
MongoDB settings, like version and backup frequency
You can improve the connection latency between the application and the database by selecting a
region closest to the location where your application is deployed. We will select AWS as our cloud
provider and the N. Virginia (us-east-1) as the location.
Importantly, there is no option to create backups in the free tier. Finally, we name the cluster and
click on Create Cluster to deploy the cluster.
Creating a starter cluster
Admin interface
It will take a couple of minutes after clicking on the Create a Cluster button to create a MongoDB
with all the options specified. Then we will be redirected to the MongoDB Atlas Admin interface. We
have named the cluster as MainDBCluster.
Admin Interface
Whitelist IP address
The first thing to do is to whitelist the IP address that can be used to access the database. By limiting
the database access to specific IP addresses, we can limit the security risk of unwanted connection
attempts to the database.
To whitelist an IP address, go to the Network Access section. Then click Add IP Address and enter
the details. We have the option to add the current IP address and configure an expiry time.
IP Whitelist page
We have selected a single IP with an expiry of six hours.
Create users
We can create users using the Database Access section in the MongoDB Atlas admin interface.
To add a user, click Add New Database User in Database Access, and enter the details of the user.
Let’s create a simple user account with the Password Authentication method and give him Read and
Write access to any database within the cluster.
Database access page
We will select the MongoDB Compass as the connection method as it would provide us a graphical
user interface (GUI) to interact with the database. After selecting the MongoDB Compass option, we
have the option to either:
Related reading
BMC Machine Learning & Big Data Blog
MongoDB Guide, a series of tutorials
Snowflake Guide
MongoDB vs Cassandra: NoSQL Databases Compared
CAP Theorem for Databases: Consistency, Availability & Partition Tolerance