1 of 12

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: Terms used in RDBMS and MongoDB

CO addressed: CO2

Course: Big Data Analytics

Presented by: Mr. P. Kiran Kumar

Department: ISE

2 of 12

2

02/09/2026

/skit.org.in

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

Sri Krishna Institute of Technology

Introduction to RDBMS and MongoDB Terms

RDBMS

  • RDBMS stands for Relational Database Management System.
  • Stores data in tables consisting of rows and columns.
  • Uses SQL (Structured Query Language) to manage data.
  • Supports relationships between tables using keys.
  • Examples: MySQL, Oracle, PostgreSQL, SQL Server

​

MongoDB

  • MongoDB is a NoSQL document-oriented database.
  • Stores data in collections as JSON-like documents.
  • Uses MongoDB Query Language (MQL) to work with data.
  • Provides a flexible schema for storing different types of data.
  • Suitable for large-scale and rapidly changing applications.

3 of 12

3

02/09/2026

/skit.org.in

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

Sri Krishna Institute of Technology

Structural Terms: RDBMS vs MongoDB

1. Database

  • A container used to store and organize data.
  • RDBMS: Contains tables.
  • MongoDB: Contains collections.

​

2. Table / Collection

  • Table: Stores related data in an RDBMS.
  • Collection: Stores related documents in MongoDB.

​

3. Row / Document

  • Row: A single record in an RDBMS table.
  • Document: A single record stored in MongoDB.
  • MongoDB documents use JSON-like BSON format.

​

4. Column / Field

  • Column: Defines an attribute of a table.
  • Field: Defines an attribute inside a MongoDB document.

4 of 12

4

02/09/2026

/skit.org.in

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

Sri Krishna Institute of Technology

Primary Key, _id and Foreign Key/Reference

1. Primary Key

  • Uniquely identifies each record in an RDBMS table.
  • Cannot contain duplicate values.
  • Example: Student_ID

2. _id in MongoDB

  • Every MongoDB document has a unique _id field.
  • Acts as the primary key of the document.
  • MongoDB automatically generates an ObjectId if _id is not provided.

3. Foreign Key

  • Used in RDBMS to link records between two tables.
  • Refers to the primary key of another table.
  • Example: Department_ID in Student table.

4. Reference in MongoDB

  • MongoDB can store a reference to a document in another collection.
  • Commonly uses the _id of the referenced document.

5 of 12

5

02/09/2026

/skit.org.in

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

Sri Krishna Institute of Technology

Example

In RDBMS:

Student

Student_ID | Name | Dept_ID

101 | Ravi | D01

Department

Dept_ID | Dept_Name

D01 | CSE

​

MongoDB

{

"_id": 101,

"name": "Ravi",

"dept_id": "D01"

}

Key Point:

Primary Key ↔ _id

Foreign Key ↔ Reference

6 of 12

6

02/09/2026

/skit.org.in

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

Sri Krishna Institute of Technology

Relationships and Joins: JOIN, Embedding, $lookup

1. JOIN in RDBMS

  • Combines data from two or more tables.
  • Uses a related column between tables.
  • Common types: INNER JOIN, LEFT JOIN, RIGHT JOIN.
  • Example: Joining Student and Department tables using Dept_ID.

​

2. Embedding in MongoDB

  • Stores related data inside the same document.
  • Reduces the need for joins.
  • Suitable for data that is frequently accessed together.

​

3. $lookup in MongoDB

  • Used to combine documents from different collections.
  • Performs a join-like operation.
  • Used within the aggregation pipeline.

{

"_id": 101,

"name": "Ravi",

"department": {

"id": "D01",

"name": "CSE"

}

}

​

7 of 12

7

02/09/2026

/skit.org.in

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

Sri Krishna Institute of Technology

Indexing and Querying: Index, SQL Query, Find Query

1. Index

  • An index improves the speed of data retrieval.
  • RDBMS and MongoDB both support indexing.

Example: Index on Student_ID or name.

​

2. SQL Query – RDBMS

  • SQL is used to retrieve and manipulate data.

Example:

SELECT * FROM Student

WHERE name = 'Ravi';

​

3. Find Query – MongoDB

  • MongoDB uses the find() method to retrieve documents.
  • Supports filtering based on field values.

Example:

db.students.find({ name: "Ravi" })

8 of 12

8

02/09/2026

/skit.org.in

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

Sri Krishna Institute of Technology

Aggregation and Transactions

1. Aggregation Pipeline – MongoDB

  • Used to process and analyze documents.
  • Data passes through multiple stages.
  • Common stages: $match, $group, $sort.
  • Similar to performing data filtering, grouping, and calculations in SQL.

​

2. ACID Transactions

Transactions ensure reliable database operations.

  • A – Atomicity: All operations succeed or none are applied.
  • C – Consistency: Data remains valid.
  • I – Isolation: Transactions do not interfere with each other.
  • D – Durability: Committed changes are permanently saved.

​

3. Commit and Rollback

  • Commit: Permanently saves the transaction
  • Rollback: Cancels changes made during the transaction

9 of 12

9

02/09/2026

/skit.org.in

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

Sri Krishna Institute of Technology

Performance and Scaling

1. Vertical Scaling

  • Increases CPU, RAM, or storage of a single server.
  • Suitable for improving the capacity of one system.

​

2. Horizontal Scaling

  • Adds multiple servers to distribute the workload.
  • Helps handle increasing users and data.

​

3. Sharding

  • Distributes data across multiple servers (shards).
  • Improves scalability for large datasets and high traffic.

​

4. Replication

  • Maintains multiple copies of data on different servers.
  • Provides high availability and fault tolerance.

10 of 12

10

02/09/2026

/skit.org.in

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

Sri Krishna Institute of Technology

Backup, Recovery and Data Integrity

1. mongodump

  • Creates a backup of MongoDB databases.
  • Stores database data in a dump directory.

​

2. mongorestore

  • Restores MongoDB data from a backup.
  • Used to recover databases after data loss.

​

3. Oplog

  • Records changes made to data in a replica set.
  • Helps with replication and recovery.

​

4. Change Streams

  • Allows applications to listen for real-time data changes.
  • Detects operations such as insert, update, and delete

11 of 12

11

02/09/2026

/skit.org.in

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

Sri Krishna Institute of Technology

Security and Authentication

1. RBAC – Role-Based Access Control

  • Assigns roles and permissions to users.
  • Controls which database operations a user can perform.

2. LDAP – Lightweight Directory Access Protocol

  • Provides centralized user authentication.
  • Commonly used to manage users and groups in organizations.

3. Kerberos

  • Provides secure authentication using tickets.
  • Helps verify the identity of users and services.

4. SCRAM – Salted Challenge Response Authentication Mechanism

  • A username and password-based authentication mechanism.
  • MongoDB uses SCRAM to authenticate database users securely.

5. Encryption

  • Protects data from unauthorized access.
  • Can protect data in transit and at rest.

12 of 12

12

02/09/2026

/skit.org.in

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

Sri Krishna Institute of Technology

MongoDB Database Commands

1. Create / Switch Database

  • Use use to create or switch to a database.
  • Database is created when data is first stored.

​

2. Verify Current Database

  • Use db to display the current database.
  • Helps verify which database is selected.

​

3. List Databases

  • Use show dbs to display available databases.
  • Shows databases that contain stored data.

​

4. Drop Database

  • Deletes the current database and its data.
  • Use carefully because the operation removes the database.
  • db.dropDatabase()

// Create / Switch to database

use collegeDB

​

// Insert data to create the database

db.students.insertOne({

_id: 101,

name: "Ravi",

department: "CSE"

})

​

// Drop the database

db.dropDatabase()