1 of 9

Sri Raghavendra Educational Institutions Society (R)

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

www.skit.org.in

Title: MongoDB

CO addressed: CO2

Course: Big Data Analytics

Presented by: Mr. P. Kiran Kumar

Department: ISE

2 of 9

2

01/09/2026

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

What is MongoDB?

Introduction to MongoDB

  • MongoDB is a NoSQL, document-oriented database.
  • It stores data in flexible JSON-like documents instead of tables and rows.
  • MongoDB uses BSON (Binary JSON) for storing documents.
  • It is open-source and cross-platform.
  • It supports large-scale data storage and high-performance applications.
  • MongoDB is widely used for web, mobile, cloud, and big data applications.

​

Key Characteristics

  • Document-Oriented
  • Flexible Schema
  • Highly Scalable
  • High Performance
  • Cross-Platform
  • High Availability

3 of 9

3

01/09/2026

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Why MongoDB?

Key Advantages of MongoDB

  • Flexible Schema – Documents can have different structures.
  • Horizontal Scaling – Data can be distributed using sharding.
  • High Availability – Replica sets provide automatic failover.
  • High Performance – Supports fast read and write operations.
  • Easy Updates – Documents can be updated without changing the entire structure.
  • Suitable for Big Data – Handles large and continuously growing datasets.

RDBMS Limitation

MongoDB Solution

Fixed schema

Flexible schema

Difficult to scale vertically

Horizontal scaling

Complex JOIN operations

Embedded documents

Handling large data can be difficult

Distributed data storage

Single-server dependency

Replication & high availability

4 of 9

4

01/09/2026

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

MongoDB Data Storage Model

JSON and BSON

  • MongoDB stores data as documents rather than rows and columns.
  • Documents have a JSON-like structure using key-value pairs.
  • Internally, MongoDB stores documents in BSON (Binary JSON) format.
  • BSON is designed for efficient storage and fast data processing.

JSON → BSON

​

JSON

{

"name": "Jack",

"age": 22,

"course": "CSE"

}

MongoDB stores it internally as BSON

5 of 9

5

01/09/2026

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Core Architecture Components

MongoDB Data Hierarchy

  • Database → Collection → Document → Field

Database

  • Contains one or more collections.
  • Example: CollegeDB

Collection

  • A group of related documents.
  • Similar to a table in RDBMS.
  • Example: Students

Document

  • Individual record stored in a collection.
  • Uses a JSON-like structure.
  • Example: Student details.

Field

  • A key-value pair inside a document.
  • Similar to a column in RDBMS.
  • Example: name, age, course

6 of 9

6

01/09/2026

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

RDBMS vs MongoDB

How RDBMS Concepts Map to MongoDB

  • Database → Database
  • Table → Collection
  • Row → Document
  • Column → Field
  • Primary Key → _id

​

Query Operations

  • SELECT → find()
  • WHERE → Query conditions db.students.find({ age: { $gt: 20 } })
  • INSERT → insertOne()
  • UPDATE → updateOne()
  • DELETE → deleteOne()

7 of 9

7

01/09/2026

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Scalability & Reliability Features

1. Replication

  • Maintains multiple copies of data on different servers.
  • A group of servers is called a Replica Set.
  • Primary node handles write operations.
  • Secondary nodes maintain copies of the primary data.
  • If the primary fails, a secondary can become the new primary automatically.
  • Provides high availability and data redundancy.

​

2. Sharding

  • Distributes large amounts of data across multiple servers.
  • Each server stores a portion of the data.
  • Helps MongoDB handle large datasets and high traffic.
  • Provides horizontal scalability.
  • Improves overall storage capacity and performance.

8 of 9

8

01/09/2026

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

MongoDB Query Language & CRUD Operations

CRUD Operations

1. Create

Adds new documents to a collection.

  • insertOne()
  • insertMany()

2. Read

Retrieves documents from a collection.

  • find()
  • findOne()

3. Update

Modifies existing documents.

  • updateOne()
  • updateMany()

4. Delete

Removes documents from a collection.

  • deleteOne()
  • deleteMany()

9 of 9

9

01/09/2026

/skit.org.in

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

Advanced Data Manipulation

Aggregation Pipeline

  • Used to process and analyze documents.
  • Data passes through a sequence of stages.
  • $match → Filters documents.
  • $group → Groups documents based on a field.
  • $sum → Calculates totals.
  • $sort → Sorts the results.

​

Other MongoDB Features

  • Array Updates – Modify values inside arrays.
  • Cursors – Process query results one document at a time.
  • Indexing – Improves query performance.
  • $lookup – Combines data from different collections.