BDTT Pre-Class-Activity 2023 24 Week9
BDTT Pre-Class-Activity 2023 24 Week9
1|Page
Table of Contents
Part 1: Introduction ....................................................................................................................... 3
2|Page
Part 1: Introduction
In this tutorial, you will learn to create a MongoDB Atlas account. MongoDB is a NoSQL database. A
NoSQL database is a type of non-relational database that stores and retrieves data in a non-tabular format.
Unlike traditional relational databases, which store data in tables with fixed columns and rows, NoSQL
databases can store unstructured, semi-structured, or even structured data.
NoSQL databases are designed to be highly scalable, flexible, and easy to use, and can handle large
volumes of data with ease. They can be distributed across multiple servers and can scale horizontally by
adding more servers to the cluster. This makes NoSQL databases ideal for handling big data and real-time
data analytics.
Among NoSQL databases, we cover MongoDB. MongoDB is a document-oriented NoSQL (non-
relational) database system. It is designed to store and manage large volumes of data, particularly
unstructured or semi-structured data, in a highly scalable and flexible manner. MongoDB uses a document
model, where data is stored in flexible JSON-like documents (Appendix-A) with dynamic schemas. This
means that the data model can evolve over time without requiring changes to the database schema.
You use MongoDB in different modes including on-premises, platform as a service and software as a
service. MongoDB Atlas is a fully managed cloud database service provided by MongoDB, Inc. It allows
users to easily deploy, manage, and scale MongoDB databases on the cloud, without the need for
infrastructure management. Atlas provides a user-friendly web-based interface for database administration
and monitoring, making it easy to create, configure, and manage MongoDB clusters. It also offers features
such as automatic scaling, automated backups, and high availability to ensure data durability and
availability.
MongoDB Atlas is available on all major cloud providers such as AWS, Google Cloud Platform, and
Microsoft Azure. It also offers integration with various tools and services such as BI platforms, search
engines, and data visualization tools.
https://www.mongodb.com/cloud/atlas/register
3|Page
2- After signing up, you will receive an email to verify your email address. Click on the corresponding
link to verify your email.
After verifying If you see the following message don’t ask for the resending and go to the next step:
5- Now you are in the Atlas environment. Whenever, you connect through a different IP, you need to add
the current IP address.
4|Page
Part 3: Creating a database
Now you need to create a database. To this end, click on “Build a Database” button.
When you are asked for the deployment mode, select M0 and create.
5|Page
Select “Username and Password” for the authentication mode.
6|Page
Then select “My Local Environment” as the location where you want to connect from.
7|Page
And finally click on “Finish and Close”.
8|Page
Part 4: Load Sample Data
In this week, we widely use the sample collections. To this end, you need to load them in advance. So, in
the main page click on “Brows Collections” tab.
9|Page
Now click on “Load a Sample Dataset”. Loading will take time and you should wait. Sample datasets will
be added to the database one by one.
10 | P a g e
Appendix – A: JSON-like documents
JSON-like documents are a data format used by many NoSQL databases, including MongoDB. These
documents are similar to JSON (JavaScript Object Notation) data format, which is a lightweight data
interchange format widely used in web applications. These documents are essentially a set of key-value
pairs, where each key corresponds to a field or attribute in the document, and the value can be a string,
number, Boolean, array, or another JSON-like document. The key-value pairs are enclosed within curly
braces, and multiple documents can be stored within a collection.
One of the key advantages of using JSON-like documents is their flexibility. Unlike traditional relational
databases, where each row must conform to a fixed schema, JSON-like documents can have varying
structures, allowing for more natural representation of real-world data. This means that documents can
evolve over time, and new fields can be added to documents without having to modify the schema of the
entire database. JSON-like documents are also easily readable and writable by many programming
languages, making it easy for developers to work with data stored in these databases. Additionally, they
can be easily mapped to objects in an application, making it easier to work with data within the
application's code.
Here's an example of a JSON-like document that might be used to store information about a user in a
MongoDB database:
In this example, the document has several fields or attributes, each represented by a key-value pair:
_id: A unique identifier for the document.
name, age, email: Simple scalar values that store information about the user.
address: A nested JSON-like document that stores information about the user's address.
interests: An array that stores a list of the user's interests.
Note that the structure of this document is flexible and can evolve over time. For example, if we wanted
to add a new field to store the user's phone number, we could simply add a new key-value pair to the
document without having to change the schema of the entire database.
11 | P a g e