NoSQL, Cloud Computing, and IOT
NoSQL, Cloud Computing, and IOT
1980s: OODBs emerged to handle data in object-oriented languages like Java and C++.
1990s: Relational databases (RDBMS) dominated, enforcing structured data storage.
2000s: As web applications and unstructured data grew, NoSQL databases emerged,
designed to handle high-scale, schema-less, distributed environments.
NoSQL became popular with big data, cloud applications, and services like Google
and Amazon needing high scalability and flexibility.
1. Key-Value Model
Diagram: A hash map or dictionary-like structure storing keys with associated
values.
Code Snippet:
json
Copy code
{
"BankID_123": { "BankName": "Bank A", "Branch": "Main Branch" }
}
2. Document Model
Diagram: Data stored in JSON or BSON documents, ideal for hierarchical structures.
Code Snippet:
json
Copy code
{
"BankID": "123",
"BankName": "Bank A",
"Branches": [
{ "BranchID": "001", "BranchName": "Main Branch" }
]
}
3. Column-Family Model
Diagram: Data organized in columns and column families, optimized for queries
across columns.
Code Snippet:
css
Copy code
BankID | BankName | BranchID | BranchName
123 | Bank A | 001 | Main Branch
4. Graph Model
Diagram: Nodes and edges representing entities and their relationships.
Code Snippet:
yaml
Copy code
Node: BankA -[HAS_BRANCH]-> Node: MainBranch
5. Aggregate Data Model (Digital Banking System)
The Aggregate Data Model is used to treat related data as a single unit.
json
Copy code
{
"BankID": "123",
"BankName": "Bank A",
"Accounts": [
{
"AccountType": "Savings",
"Rewards": ["Reward1", "Reward2"]
}
],
"Payments": [
{
"PaymentID": "456",
"Amount": 100,
"Date": "2023-10-08"
}
]
}
6. Comparison: Content Management System (CMS) & College Library Management System
Feature CMS (RDBMS) CMS (NoSQL) Library (RDBMS) Library (NoSQL)
Schema Flexibility Fixed Flexible Fixed Flexible
Query Complexity Complex queries supported Limited complex querying
Complex queries supported Limited querying
Scalability Limited (vertical scaling) High (horizontal scaling) Limited
High
Data Integrity Strong ACID support Weaker consistency models Strong ACID
Weaker consistency models
Use Case Suitability CMS fits NoSQL for flexibility CMS fits NoSQL for
scalability RDBMS for structured data NoSQL for unstructured data
Conclusion: CMS is better suited for NoSQL for scalability and flexibility, while
Library Management is better suited for RDBMS for structured data.
Resolution:
19. Quorums
Quorums involve a majority of nodes agreeing on a read or write operation before it
is considered successful. Example: In Cassandra, a quorum read requires a majority
of nodes to return the most recent data.