📘 Big Data Unit 4

NoSQL, Business Drivers, Architectural Patterns, Managing Big Data and MongoDB

Unit 4

🎯 Unit 4 Overview

Big Data Unit 4 mainly covers NoSQL databases and MongoDB. NoSQL databases are used to store and manage large-scale structured, semi-structured and unstructured data.

Exam Tip: NoSQL vs SQL, types of NoSQL databases, NoSQL architectural patterns and MongoDB are highly important for RGPV exams.

📘 Introduction to NoSQL

NoSQL stands for Not Only SQL. It is a type of database system that can store data in flexible formats other than traditional tables. NoSQL is useful when data is huge, fast-changing and not always structured.

Why NoSQL is Needed?

Simple Meaning: Jab data fixed table format me nahi hota aur size bahut bada hota hai, tab NoSQL databases use kiye jaate hain.

⭐ Features of NoSQL

⚖️ SQL vs NoSQL

SQL Database NoSQL Database
Uses fixed schema Schema-less or flexible schema
Stores data in tables Stores data in documents, key-value, graphs or columns
Best for structured data Best for semi-structured and unstructured data
Vertical scaling Horizontal scaling
Examples: MySQL, Oracle Examples: MongoDB, Cassandra, Redis, Neo4j

🏢 Business Drivers of NoSQL

Business drivers are the reasons due to which companies adopt NoSQL databases.

🏗️ Data Architectural Patterns

Data architectural patterns define how data is stored, processed and accessed in a system.

Pattern Description
Data Warehouse Pattern Stores historical structured data for reporting and analysis.
Data Lake Pattern Stores raw structured, semi-structured and unstructured data.
Lambda Architecture Combines batch processing and real-time processing.
Microservices Data Pattern Each service manages its own database.
Distributed Database Pattern Data is distributed across multiple nodes or servers.

🧩 NoSQL Architectural Patterns

NoSQL architectural patterns explain different ways in which NoSQL databases store data.

NoSQL Type Storage Style Example
Key-Value Store Stores data as key-value pairs Redis, DynamoDB
Document Store Stores data as documents like JSON/BSON MongoDB, CouchDB
Column Family Store Stores data in column families Cassandra, HBase
Graph Database Stores data as nodes and relationships Neo4j

📂 Types of NoSQL Databases

1. Key-Value Database

Data is stored in key-value pair format. It is simple and very fast.

2. Document Database

Data is stored in document format such as JSON or BSON.

3. Column-Oriented Database

Data is stored in columns instead of rows. It is useful for large analytical workloads.

4. Graph Database

Data is stored as nodes and edges. It is useful for relationship-based data.

📊 Managing Big Data with NoSQL

NoSQL helps in managing Big Data because it supports distributed storage, flexible schema and high-speed processing.

How NoSQL Manages Big Data?

  1. Data is distributed across multiple servers.
  2. Flexible schema allows different data formats.
  3. Replication improves availability and fault tolerance.
  4. Sharding divides data into smaller parts.
  5. Horizontal scaling adds more servers when data increases.
  6. Fast read/write operations support real-time applications.

🍃 Introduction to MongoDB

MongoDB is a popular open-source NoSQL database. It stores data in document format using BSON, which is similar to JSON.

Features of MongoDB

Important: MongoDB me data table ke form me nahi, balki collection aur document ke form me store hota hai.

📌 MongoDB Basic Terms

MongoDB Term Meaning SQL Equivalent
Database Collection of related data Database
Collection Group of documents Table
Document Single record in BSON/JSON format Row
Field Key-value pair inside document Column

💻 MongoDB Document Example

{
  "rollNo": 101,
  "name": "Amit",
  "branch": "CSE",
  "semester": 7,
  "skills": ["Hadoop", "MongoDB", "Big Data"]
}

⚙️ MongoDB Commands

show dbs
use college
db.students.insertOne({name:"Amit", branch:"CSE", semester:7})
db.students.find()
db.students.updateOne({name:"Amit"}, {$set:{semester:8}})
db.students.deleteOne({name:"Amit"})

✅ Advantages of MongoDB

⚠️ Limitations of MongoDB

⭐ Important Questions

  1. What is NoSQL? Explain its features.
  2. Differentiate between SQL and NoSQL databases.
  3. Explain business drivers of NoSQL.
  4. Explain data architectural patterns.
  5. Explain NoSQL architectural patterns.
  6. Explain types of NoSQL databases with examples.
  7. How does NoSQL manage Big Data?
  8. What is MongoDB? Explain its features.
  9. Explain MongoDB terms: database, collection, document and field.
  10. Write advantages and limitations of MongoDB.

🔥 Last Minute Revision

🔗 Related Links