Skip to content
AD-801 · Big Data/Quick Revision Short Notes

Big Data (AD-801) - Unit 4 Short Notes

How unit 4 is examined

This unit covers what NoSQL is, why it arose, its four architectural patterns and MongoDB; the marks sit on MongoDB (14 marks, CRUD with examples) and NoSQL versus SQL (7 marks).

Introduction to NoSQL

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>

Definition. <mark>NoSQL ("Not Only SQL") databases store data in non-relational models, without fixed tables and joins, and are built to scale out across many commodity servers for big, varied, fast-changing data.</mark>

Key points.

  1. NoSQL has four main types: key-value (Redis), document (MongoDB), column-family (Cassandra) and graph (Neo4j), each fitting a different access pattern.
  2. SQL (RDBMS) stores structured rows in fixed tables, enforces a schema, supports joins and full ACID transactions (atomicity, consistency, isolation, durability).
  3. NoSQL trades strict consistency for availability and partition tolerance (BASE: basically available, soft state, eventual consistency; see the CAP theorem).
  4. NoSQL is chosen for large, unstructured, fast-changing data and horizontal scaling on cheap commodity hardware.
  5. SQL remains the better choice where data is highly structured and correctness of every transaction matters, such as banking.
Basis SQL (RDBMS) NoSQL
Data model Tables of rows and columns Key-value, document, column, graph
Schema Fixed, predefined Dynamic, schema-less
Scalability Vertical (bigger server) Horizontal (add nodes)
Query language Structured Query Language No standard; each store has its own API
Transactions ACID, strong consistency BASE, eventual consistency
Relationships Joins across tables Embedding or references; few joins
Use cases Banking, ERP, accounting Social media, IoT, real-time analytics, catalogues

Answer frame. Open with the NoSQL definition; list the four types in one line; give the 7-row table as the body; close with one line that NoSQL suits big flexible data while SQL suits structured transactional data.

Asked: [7 marks] (Jun 2025) Explain NoSQL and write differences between NoSQL and SQL.

NoSQL Business Drivers

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. <mark>Business drivers are the pressures that pushed organisations from purely relational databases to NoSQL: volume, velocity, variability and agility.</mark>

Key points.

  1. Volume: data grew beyond what one server can hold, so systems must scale out across cheap machines.
  2. Velocity: high-speed reads and writes, such as clickstreams and sensor feeds, need low-latency stores.
  3. Variability: semi-structured and unstructured data does not fit fixed tables.
  4. Agility: schema-less design lets developers change the data model without costly migrations, and open-source NoSQL also cuts licence cost.
  5. Availability: web-scale services must stay up around the clock, and replicated NoSQL clusters survive node failures.
  6. Cost: scaling out on commodity servers is far cheaper than buying one large specialised machine.

NoSQL Data architectural patterns

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. <mark>NoSQL architectural patterns are the four ways NoSQL stores data: key-value, column-family, document and graph.</mark>

Key points.

  1. Key-value store: a hash table mapping a unique key to an opaque value; fastest and simplest (Redis, DynamoDB).
  2. Column-family store: data grouped by columns into families, good for huge sparse tables and writes (Cassandra, HBase).
  3. Document store: self-describing JSON or BSON documents that can nest (MongoDB, CouchDB).
  4. Graph store: nodes and edges with properties, suited to relationships (Neo4j).
  5. Each pattern suits a use case: sessions and caches use key-value, analytics on wide data uses column-family, catalogues and content use documents, social networks and recommendations use graphs.
  6. All four scale horizontally and avoid joins, which is what separates them from the relational model.

Variations of NoSQL architectural patterns using NoSQL to Manage Big Data

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. <mark>These variations adapt the patterns to big data by distributing data over many nodes using sharding, replication and MapReduce.</mark>

Key points.

  1. Sharding splits data across nodes by key so each node holds part of it, which spreads load and storage.
  2. Replication keeps copies on several nodes, giving availability and fault tolerance.
  3. Master-slave replication has one writer and read replicas; peer-to-peer has every node accept writes.
  4. MapReduce processes the distributed data in parallel, and hybrid systems combine a NoSQL store with Hadoop.
  5. Consistent hashing places keys on nodes so that adding or removing a node moves only a small share of the data.
  6. Choosing a pattern depends on the query: key lookup suits key-value, relationships suit graph, nested records suit document.

Introduction to MongoDB

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>

Definition. <mark>MongoDB is an open-source, document-oriented NoSQL database that stores data as flexible JSON-like BSON documents grouped in collections, instead of rows in tables.</mark>

Diagram. <figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u4-01" viewBox="0 0 1032 258" width="1032" height="258" role="img" aria-label="MongoDB hierarchy: database holds collections, a collection holds documents (table = collection, row = document, column = field)"><style>#dsfig-u4-01 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u4-01 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u4-01 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u4-01 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u4-01 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u4-01 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u4-01 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u4-01 .t{fill:#16181D;font-weight:500}#dsfig-u4-01 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u4-01 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u4-01 .dot{fill:#16181D}#dsfig-u4-01 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u4-01 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u4-01 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u4-01 .ah{fill:#454C5A}#dsfig-u4-01 .ah.hi{fill:#2340B8}#dsfig-u4-01 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u4-01 .wl .t{font-size:12px;font-weight:700}#dsfig-u4-01 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u4-01 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u4-01 .e{stroke:#B1B7C3}html.dark #dsfig-u4-01 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u4-01 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u4-01 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u4-01 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u4-01 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u4-01 .t{fill:#E6E8ED}html.dark #dsfig-u4-01 .t.inv{fill:#0F1115}html.dark #dsfig-u4-01 .kd{stroke:#E6E8ED}html.dark #dsfig-u4-01 .dot{fill:#E6E8ED}html.dark #dsfig-u4-01 .ann{fill:#8FA3FF}html.dark #dsfig-u4-01 .lbl{fill:#858D9C}html.dark #dsfig-u4-01 .ptr{fill:#8FA3FF}html.dark #dsfig-u4-01 .ah{fill:#B1B7C3}html.dark #dsfig-u4-01 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u4-01 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u4-01 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u4-01 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah4" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh4" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><line class="e" x1="924" y1="37" x2="504" y2="101"/><line class="e" x1="504" y1="101" x2="224" y2="165"/><line class="e" x1="504" y1="101" x2="784" y2="165"/><line class="e" x1="224" y1="165" x2="84" y2="229"/><line class="e" x1="224" y1="165" x2="364" y2="229"/><line class="e" x1="784" y1="165" x2="644" y2="229"/><rect class="n" x="859" y="22" width="130" height="30" rx="8"/><text class="t" x="924" y="37" dy=".35em" text-anchor="middle">MongoDB server</text><rect class="n" x="462.5" y="86" width="83" height="30" rx="8"/><text class="t" x="504" y="101" dy=".35em" text-anchor="middle">Database</text><rect class="n" x="167" y="150" width="114" height="30" rx="8"/><text class="t" x="224" y="165" dy=".35em" text-anchor="middle">Collection 1</text><rect class="n" x="42.5" y="214" width="83" height="30" rx="8"/><text class="t" x="84" y="229" dy=".35em" text-anchor="middle">Document</text><rect class="n" x="322.5" y="214" width="83" height="30" rx="8"/><text class="t" x="364" y="229" dy=".35em" text-anchor="middle">Document</text><rect class="n" x="727" y="150" width="114" height="30" rx="8"/><text class="t" x="784" y="165" dy=".35em" text-anchor="middle">Collection 2</text><rect class="n" x="602.5" y="214" width="83" height="30" rx="8"/><text class="t" x="644" y="229" dy=".35em" text-anchor="middle">Document</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">MongoDB hierarchy: database holds collections, a collection holds documents (table = collection, row = document, column = field)</figcaption></figure>

Key points.

  1. Schema-less: documents in one collection can have different fields, so the structure can change without migration.
  2. Document model: data is stored in BSON, a binary form of JSON, and related data can be nested inside one document.
  3. Scalability: sharding spreads data horizontally across servers.
  4. High availability: replica sets keep copies and elect a new primary if one fails.
  5. Indexing: any field can be indexed to speed queries, including compound and text indexes.
  6. Aggregation: the aggregation pipeline ($match, $group, $sort) processes and summarises data.
  7. Rich query language: operators such as $gt, $lt, $in, $and and $or filter documents directly.
  8. Every document gets a unique _id field automatically, which acts as its primary key, and drivers exist for most languages.

Steps (CRUD).

Create : db.students.insertOne({name:"Ravi", age:21, branch:"AD"})
         db.students.insertMany([{name:"Asha", age:20}, {name:"Om", age:22}])
Read   : db.students.find({age:{$gt:20}})       // filter
         db.students.findOne({name:"Ravi"})
Update : db.students.updateOne({name:"Ravi"}, {$set:{age:22}})
Delete : db.students.deleteOne({name:"Om"})

Example. After the inserts, students holds Ravi (21), Asha (20) and Om (22). find({age:{$gt:20}}) returns Ravi and Om. updateOne sets Ravi's age to 22, and deleteOne removes Om, leaving Ravi (22) and Asha (20). An aggregation such as db.students.aggregate([{$group:{_id:"$branch",avg:{$avg:"$age"}}}]) returns the average age per branch.

Answer frame. Open with the definition; draw the database-collection-document figure; develop key points 1-7 in order, then CRUD with one command and a short result each; close with one line that MongoDB suits flexible, scalable applications.

Pitfall: Update without $set replaces the whole document instead of changing one field.

Asked: [14 marks] (Jun 2025) What is Mongo DB? Explain in brief key features of Mongo DB. Show basic CRUD operations in Mongo DB with proper example.

Last-minute revision

  • NoSQL means "Not Only SQL": non-relational, schema-less, horizontally scalable, built for big and varied data.
  • Four types: key-value (Redis), document (MongoDB), column-family (Cassandra), graph (Neo4j).
  • SQL: fixed schema, tables and joins, ACID, vertical scaling, SQL language.
  • NoSQL: dynamic schema, no joins, BASE, horizontal scaling, no standard query language.
  • BASE = Basically Available, Soft state, Eventual consistency; ACID = Atomicity, Consistency, Isolation, Durability.
  • Business drivers: volume, velocity, variability, agility (plus availability and cost).
  • Sharding splits data across nodes; replication keeps copies for availability; MapReduce processes in parallel.
  • MongoDB stores BSON documents in collections; table = collection, row = document, column = field.
  • Every MongoDB document has a unique _id that works as its primary key.
  • CRUD: insertOne/insertMany, find/findOne, updateOne with $set, deleteOne/deleteMany.
  • MongoDB features: schema-less, sharding, replica sets, indexing, aggregation pipeline.
  • Comparison operators: $gt, $lt, $gte, $lte, $in, $ne.

Memory hooks

  • KDCG: Key-value, Document, Column, Graph are the four NoSQL types.
  • ACID is strict like an acid test; BASE is relaxed and settles later.
  • CRUD: Create is insert, Read is find, Update is $set, Delete is delete.
  • SQL scales Up (bigger box), NoSQL scales Out (more boxes).
  • Volume, Velocity, Variability, Agility: the "VVVA" push to NoSQL.
  • Mongo: Database holds Collections, Collections hold Documents (D-C-D).

Coverage checklist

  • Introduction to NoSQL: definition, four types, SQL versus NoSQL table (Jun 2025, 7 marks).
  • NoSQL Business Drivers: volume, velocity, variability, agility, availability, cost.
  • NoSQL Data architectural patterns: key-value, column-family, document, graph with use cases.
  • Variations of NoSQL architectural patterns using NoSQL to Manage Big Data: sharding, replication, MapReduce, hashing.
  • Introduction to MongoDB: definition, hierarchy, features, CRUD examples (Jun 2025, 14 marks).
Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in