0% found this document useful (0 votes)
77 views6 pages

MST Unit 5

The document provides an overview of MongoDB, a document-oriented NoSQL database known for its flexibility and scalability, detailing its architecture, features, and use cases. It explains how to create databases and collections, as well as the deployment of web applications using cloud platforms like AWS and MongoDB Atlas. Key topics include security measures, database management, and the process of connecting applications to MongoDB.
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)
77 views6 pages

MST Unit 5

The document provides an overview of MongoDB, a document-oriented NoSQL database known for its flexibility and scalability, detailing its architecture, features, and use cases. It explains how to create databases and collections, as well as the deployment of web applications using cloud platforms like AWS and MongoDB Atlas. Key topics include security measures, database management, and the process of connecting applications to MongoDB.
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/ 6

UNIT V: Mongo DB: Introduction, Architecture, Features, Examples, Database Creation &

Collection in Mongo DB. Deploying Applications: Web hosting & Domains, Deployment
Using Cloud Platforms.

Mongo DB: Introduction

MongoDB is a popular, open-source, document-oriented NoSQL database. It's designed for


storing and retrieving data in a flexible format, unlike traditional relational databases that use
tables. MongoDB stores data in BSON (Binary JSON) format, allowing for efficient and
scalable storage.

Here's a more detailed look:

 Document-Oriented:
MongoDB stores data as documents, which are similar to JSON objects, consisting of key-
value pairs.
 NoSQL:
As a NoSQL database, MongoDB does not rely on tables and fixed schemas like relational
databases.
 Flexible Schema:
MongoDB provides flexibility in data storage, allowing for dynamic schemas where
documents within a collection can have different structures.
 Scalability:
MongoDB supports horizontal scaling, allowing you to distribute data across multiple
servers for high availability and performance.
 Features:
MongoDB offers features like indexing, aggregation pipelines (for data transformation),
and server-side JavaScript execution for enhanced data management.
 Use Cases:
MongoDB is often used for applications requiring flexibility, scalability, and high
performance, including web applications, content management systems, and big data
analytics

Mongo DB Architecture

MongoDB Architecture and its Components


MongoDB's architecture consists of several core components that work together to provide
efficient data storage, retrieval and processing.
1. Drivers & Storage Engine
MongoDB store the data on the server but that data we will try to retrieve from our
application. So that time how the communication is happening between our application and
MongoDB server. Any application which is written in python, .net and java or any kind of
frontend application, these application are trying to access the data from these physical
storage in server.
First they will interact with driver which will communicate with MongoDB server. What
happen is once the request is going from the frontend application through the driver then
driver will change appropriate query by using query engine and then the query will get
executed in MongoDB data model. Left side is security which provides security to
the database that who will access the data and right side is management this management
will manage all these things.
Drivers
Drivers are client libraries that offer interfaces and methods for applications to
communicate with MongoDB databases.
Storage Engine
The storage engine significantly influences the performance of applications, serving as an
intermediary between the MongoDB database and persistent storage, typically disks.
MongoDB supports different storage engines:

Security in MongoDB
Mongodb provides various security mechanisms to protect data from unauthorized access
and breaches
 Authentication - Verifies user credentials
 Authorization - Assigns role -based access controls (RBAC).
3. MongoDB Server
It serves as the central element and is in charge of maintaining, storing, and retrieving
data from the database through a number of interfaces.

MangoDB Feature

MongoDB is a document-oriented, non-relational database known for its flexibility and


scalability. Key features include document-oriented storage, a schema-less approach,
indexing, aggregation, sharding, replication, and support for various use cases like web
applications, mobile apps, and data warehousing.

Key Features in Detail:

1. Document-Oriented:

MongoDB stores data in JSON-like documents, making it suitable for hierarchical and
complex data structures.

2. Schema-less:

MongoDB does not require a predefined schema, offering flexibility for data modeling and
evolving applications.

3. Indexing:

MongoDB supports various indexing options, allowing for efficient querying and faster data
retrieval.

4. Aggregation:

MongoDB's aggregation framework allows for powerful data processing and transformation
pipelines.

5. Replication:

MongoDB supports replication, ensuring data availability and resilience by creating


redundant copies of data across multiple servers.
6. Scalability:

MongoDB's horizontal scaling capabilities allow it to handle large volumes of data and high
traffic loads.

Database Creation: Databases are created when you insert data into them. You can create
or switch to a database using the following command:
use <database_name>
This command actually switches you to the new database if the given name does not exist
and if the given name exists, then it will switch you to the existing database. Now at this
stage, if you use the show command to see the database list where you will find that
your new database is not present in that database list because, in MongoDB, the database
is actually created when we start entering data in that database.
4. View Database: To see how many databases are present in your MongoDB server, write
the following statement in the mongo shell:
show dbs

What is a Collection in MongoDB?


A Collection in MongoDB is similar to a table in relational databases. It holds a group of
documents and is a part of a database. Collections provide structure to data, but like the rest
of MongoDB, they are schema-less.
Schemaless
As we know that MongoDB databases are schemaless. So, it is not necessary in a
collection that the schema of one document is similar to another document. Or in other
words, a single collection contains different types of documents like as shown in the below
example where mystudentData collection contain two different types of documents:
Multiple Collections per Database
A single database can contain multiple collections, each storing different types of
documents.

Web hosting & Domains, Deployment Using Cloud Platforms

Deploying web hosting and domains with MongoDB using cloud platforms
involves leveraging cloud services to manage your web application's infrastructure, including
the database and web server, while also handling domain registration and management. This
can be achieved by using cloud providers like AWS, Azure, Google Cloud, or even dedicated
MongoDB cloud solutions like MongoDB Atlas.

1. Choosing a Cloud Platform:

 Cloud Providers:
AWS, Azure, and Google Cloud offer various services for web hosting, database
management (including MongoDB), and domain registration/management.
 MongoDB Cloud Solutions:
MongoDB Atlas is a fully managed cloud database service specifically designed for
MongoDB.
2. Web Hosting and Application Deployment:

 Web Hosting:
Choose a cloud service that provides web hosting, such as an App Service, Virtual
Machine, or a serverless function.
 Application Deployment:
Deploy your web application's code to the web hosting service. This can involve using
deployment tools or manually uploading your application files.
3. MongoDB Database Setup:

 Database as a Service (DBaaS):


Utilize a cloud DBaaS offering for MongoDB, like MongoDB Atlas, or manage MongoDB
instances within your cloud provider's virtual machines.
 Infrastructure as a Service (IaaS):
Set up MongoDB instances on virtual machines within your cloud provider's IaaS
infrastructure.
4. Domain Management:

 Domain Registration: Register your domain name with a domain registrar.


 DNS Configuration: Configure the Domain Name System (DNS) records to point your
domain to your web hosting provider's servers.
 Domain Mapping: If using MongoDB Atlas, you might need to manage domain mapping for
federated authentication.
5. Connecting Web Application to MongoDB:

 Connection String:
Obtain the MongoDB connection string from your cloud provider or MongoDB Atlas.
 Application Code:
Use the connection string in your web application's code to connect to the MongoDB
database.
6. Scaling and Performance:

 Elastic Scaling: Leverage the cloud platform's elastic scaling capabilities to automatically
adjust resources based on demand.
 Load Balancing: Use load balancers to distribute traffic across multiple web servers.
 Caching: Implement caching strategies to improve page load times.
7. Security:
 Firewall Rules: Configure firewall rules to restrict access to your MongoDB instances.
 Authentication: Implement secure authentication mechanisms for your web application and
MongoDB.
 Encryption: Utilize encryption for data at rest and in transit.

You might also like