MongoDB and crud operations with nosql_ppt.pdf

HemrajAunund2 20 views 8 slides Jul 10, 2024
Slide 1
Slide 1 of 8
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8

About This Presentation

MongoDB


Slide Content

MONGODB
AND
CRUD
OPERATION
S
ASHNA BEGUM
TEELUCK
YASHVEER
PREPARED
BY:

Agenda
oWhat is MongoDB
oMongoDB VS RDBMS
oWhy MongoDB
oUse cases
oCRUD operations in MongoDB
oDemonstration
2

What is MongoDB
•MongoDB is a type of database management
system that falls under the category of NoSQL
databases.
•Unlike traditional relational
databases(RDBMS), which use tables to store
data, MongoDB adopts a document-oriented
approach, organizing data in flexible, JSON-
like BSON documents
3

MONGODB
VS
RDBMS
A COL L ECTI ON I N
MONGODB I S E QUI VA L E NT
TO A TABL E I N RDBMS
A DOCUMENT I N MONGODB
I S E QUI VA L E NT TO A ROW
I N RDB MS
A F I EL D I N MONGODB I S
E QUI VA L E NT TO A COL UMN
I N RDB MS

Why use MongoDB
5
Document-Oriented
Storage
•MongoDB stores data in flexible, JSON-
like BSON (Binary JSON) documents
where each document can have a varied
structure, allowing for the representation of
complex and nested data
Dynamic Schema
•MongoDB features a dynamic
schema, allowing documents in the
same collection to have different
fields and structures.
Scalability and Horizontal
Scaling
•MongoDB is designed for horizontal
scalability, enabling the distribution of data
across multiple servers or clustersthat
facilitates handling large volumes of data
and increased traffic.
Open Source and Active
Community
•MongoDB is open-source software,
providing free access to its source code for
modification and distribution.
Support for ACID
Properties and
Transactions
•MongoDB offers support for ACID
(Atomicity, Consistency, Isolation,
Durability) properties, ensuring data
consistency and reliability.
MongoDB's flexibility, scalability, and ease of use make it a popular choice for
developers and organizations looking to manage diverse and growing datasets in
a modern, agile environmentalong with the manykey characteristics that sets it
apart.

Use cases
E-Commerce
•In the realm of E-commerce,
MongoDB serves as a powerful
and flexible database solution,
addressing the dynamic nature
of online retail environments.
•Its document-oriented structure
allows for the efficient storage of
diverse data types associated
with products, such as images,
descriptions, and specifications.
The dynamic schema enables
E-commerce platforms to easily
adapt to evolving product
attributes and changing
business requirements without
the constraints of a rigid
schema.
Social Network
•MongoDB proves to be a valuable
database solution, addressing the
dynamic and interconnected
nature of social interactions. Its
document-oriented model allows
for the storage of diverse user
data, including profiles, posts,
comments, and multimedia
content, in a flexible and scalable
manner.
•The dynamic schema
accommodates changes in user
profiles and content types over
time, providing the agility needed
in evolving social network
platforms.
Internet of Things
(IoT)
•MongoDB serves as a robust and
adaptive database solution,
offering seamless integration with
the dynamic and diverse data
generated by IoT devices.
•As IoT environments typically
involve a massive influx of data
from sensors, devices, and
connected systems, MongoDB's
scalability becomes paramount,
enabling efficient management of
large volumes of real-time data.
6

CRUD Operations
7
Create
•New data is added to a collection using methods
likeinsertOne() or insertMany().
Read
•Existing data is retrieved using the find()
method, allowing developers to query and
filter documents based on specific criteria,
providing versatile and efficient data
retrieval.
Update
•The updateOne() or updateMany() methods are
employed to modify existing documents, allowing
for changes to specific fields or values within the
data.
Delete
•Unwanted data is removed from a collection using
the deleteOne() or deleteMany() methods,
ensuring effective data management.
•CRUD operations in MongoDB encompass the fundamental actions
involved in managing data within the database.

The acronym CRUD represents Create, Read, Update, and Delete,
forming the cornerstone of data manipulation.

THANK
YOU
8