0% found this document useful (0 votes)
27 views

Wa0003.

Uploaded by

suraj verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Wa0003.

Uploaded by

suraj verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Lab 1: NoSQL with MongoDB: Installation

Introduction:
NoSQL databases are a category of database systems that deviate from the traditional relational
database model. They are designed to handle large volumes of unstructured or semi-structured data
more efficiently than SQL databases. Here's a brief overview of what NoSQL databases are, why
they are useful, and their key differences compared to regular SQL databases:

NoSQL:

NoSQL stands for "Not Only SQL." It represents a wide range of database technologies that
are non-relational and schema-less, meaning they don't require a fixed table schema like SQL
databases. NoSQL databases are often used for handling unstructured, semi-structured, or
rapidly changing data, common in modern web and mobile applications, IoT, and big data
scenarios.
Usefulness of NoSQL:

• Flexible Schema: NoSQL databases allow you to store and manage data without a predefined
schema, making it easier to handle evolving data structures and accommodating changes
without costly migrations.
• Scalability: NoSQL databases are designed to be horizontally scalable, distributing data
across multiple nodes, which enables them to handle massive amounts of data and high traffic
loads.
• High Performance: With their simplified data models and efficient storage formats, NoSQL
databases can provide fast read and write operations, making them suitable for real-time and
big data applications.
• Availability: NoSQL databases often prioritize high availability, ensuring that the system
remains operational even in the face of failures or network partitions.

Differences with Regular SQL:

• Data Model: In SQL databases, data is organized into structured tables with fixed schemas,
and relationships between tables are maintained using foreign keys. NoSQL databases, on
the other hand, use various data models like document-based, key-value, column-family, or
graph to store and manage data.
• Query Language: SQL databases use SQL (Structured Query Language) for querying and
manipulating data. NoSQL databases, depending on their type, may use different query
languages or APIs such as JSON-based queries for document databases, simple key-value
access, or specialized graph traversal languages for graph databases.
• ACID Transactions: SQL databases usually support ACID (Atomicity, Consistency,
Isolation, Durability) transactions, ensuring data integrity. NoSQL databases may provide
weaker consistency models (like eventual consistency) to achieve high availability and
scalability.
• Schema Evolution: NoSQL databases allow for dynamic and schema-less data models,
making it easier to modify data structures without needing to alter the entire database schema.
In contrast, SQL databases require schema changes to add or remove columns or change data
types.
• Scalability: NoSQL databases are typically designed to scale horizontally by adding more
nodes to the cluster, whereas scaling SQL databases often involves vertical scaling by
upgrading hardware or using sharding techniques.

MongoDB:

MongoDB is a leading NoSQL database renowned for its document-oriented approach to


data storage. Instead of using traditional tables, MongoDB organizes data in JSON-like
documents, allowing for dynamic and evolving data schemas. Its schema flexibility enables
developers to modify data structures without requiring database migrations, making
application development more agile. MongoDB excels in high performance and scalability,
distributing data across multiple servers to ensure rapid read and write operations and handle
large datasets. With a rich and user-friendly query language, MongoDB facilitates easy data
retrieval and manipulation. It finds applications in various domains, from web and mobile
applications to real-time analytics and IoT data storage. MongoDB's active community and
extensive ecosystem of tools and frameworks make it a preferred choice for modern data-
driven applications.
Steps to Install MongoDB:

1. Download MongoDB

• Go to the official MongoDB website:


https://www.mongodb.com/try/download/community
• Scroll down to the "Community Server" section.
• Click on the "Windows" tab.
• Download the latest stable version of MongoDB for Windows (MSI package).

2. Run the MongoDB installer

• Locate the downloaded MSI file and double-click on it to run the installer.
• The installer wizard will guide you through the installation process.
3. Choose Setup Type

• In the installer, choose the "Complete" setup type to install all the MongoDB
components.
• You can customize the installation path if you prefer, but the default path is usually
fine.

4. Install MongoDB as a Service (Optional)

• Check the box "Install MongoDB as a Service" if you want MongoDB to start
automatically with Windows.
5. Finish the Installation

• Click "Next" to start the installation process.


• Once the installation is complete, click "Finish."

6. Set Up Data Directory

• By default, MongoDB will store data in the "\data\db" directory on the drive where
MongoDB is installed (e.g., C:\Program Files\MongoDB\Server{version}\data\db).
• If you want to use a different data directory, create a new folder and remember its path
for later use.

7. Add MongoDB to the System Path (Optional)

• If you want to use MongoDB from the Command Prompt or PowerShell, you can add
the MongoDB binaries to the system's PATH environment variable.
• To do this, search for "environment variables" in the Windows search bar, and click on
"Edit the system environment variables."
• In the System Properties window, click the "Environment Variables" button.
• Under "System variables," scroll down to the "Path" variable, and click "Edit."
• Click "New" and add the path to the MongoDB bin directory.
• Click "OK" to save the changes.

Installing MongoDB Compass and MongoDB Shell:

1. Download MongoDB Compass


• Go to the official MongoDB website:
https://www.mongodb.com/try/download/compass
• Scroll down to the "Community Edition" section.
• Click on the "Windows" tab.
• Download the latest stable version of MongoDB Compass for Windows (exe package).

2. Run the MongoDB Compass installer

• Locate the downloaded MSI file and double-click on it to run the installer.
• The installer wizard will guide you through the installation process.
• Click "Next" and then "Install" to proceed with the installation.
• Once the installation is complete, click "Finish."
3. Download MongoDB Shell

• Go to the official MongoDB website: https://www.mongodb.com/try/download/shell


• Scroll down to the "Community Edition" section.
• Click on the "Windows" tab.
• Download the latest stable version of MongoDB Shell for Windows (MSI package).

4. Run the MongoDB Shell installer

• Locate the downloaded MSI file and double-click on it to run the installer.
• The installer wizard will guide you through the installation process.
• Click "Next" and then "Install" to proceed with the installation.
• Once the installation is complete, click "Finish."

5. Add MongoDB Shell to the System Path

• If you want to use the MongoDB Shell (mongo) from the Command Prompt or
PowerShell, you can add the MongoDB Shell binaries to the system's PATH environment
variable.
• Start MongoDB Compass

6. Connect to MongoDB with MongoDB Compass

• In MongoDB Compass, you will be prompted to connect to a MongoDB instance.


• By default, Compass connects to a local MongoDB server running on "localhost" and
port "27017."
• Click on the "Connect" button, and Compass will establish a connection to your
MongoDB server.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy