0% found this document useful (0 votes)
3 views

NoSQL, Cloud Computing, and IOT

Vtu 2021 scheme Notes

Uploaded by

syed arif
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

NoSQL, Cloud Computing, and IOT

Vtu 2021 scheme Notes

Uploaded by

syed arif
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

Value of Relational Database


A Relational Database uses tables to store data, ensuring structure, organization,
and relationships between data. It supports SQL (Structured Query Language) for
querying. The primary value of relational databases includes:

Data Integrity: Strong enforcement of ACID (Atomicity, Consistency, Isolation,


Durability) properties ensures data accuracy.
Structured Data: Data is stored in predefined schemas, enabling easy organization
and access.
Relationships: Complex queries involving multiple tables are easily supported.
Scalability for Transactions: Efficiently handles complex transactions in business
applications like banking and ERP systems.
2. NoSQL and Advantages over RDBMS
NoSQL databases are non-relational and designed to handle distributed,
unstructured, or semi-structured data. They do not require fixed schemas and
support horizontal scaling. Advantages of NoSQL over RDBMS include:

Scalability: Easily scalable across multiple servers for big data.


Flexibility: No fixed schema, making it ideal for handling unstructured data.
High Throughput: Designed for high-speed data ingestion and querying.
Handling Large Volumes: Suitable for web-scale applications (e.g., social media).
Examples of NoSQL: MongoDB, Cassandra, Redis.

3. Evolution of Databases from Object-Oriented to NoSQL


The evolution from Object-Oriented Databases (OODB) to NoSQL is marked by:

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.

4. NoSQL Data Models for a Digital Banking System


A digital banking system requires storing banks, branches, account types, rewards,
and payment details. The four types of NoSQL data models are:

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.

7. Conflict in Shared Google Sheet


Conflict: Bob’s update overwrites Alice’s unsaved changes, causing data loss.

Resolution:

Version Control: Implement version control to keep track of changes.


Locking Mechanism: Lock the file during updates.
Real-Time Sync: Use real-time collaboration tools to sync updates.
8. Types of Consistency with Example
Strong Consistency: Guarantees that all nodes reflect the most recent write (e.g.,
bank account balances).
Eventual Consistency: Updates propagate eventually (e.g., social media likes).
Causal Consistency: Ensures consistency for causally related operations (e.g.,
comments follow posts in social networks).
9. Impedance Mismatch
Impedance mismatch occurs when the object-oriented programming model (objects) does
not align well with the relational data model (tables). For example, storing a
tree-like object structure in RDBMS requires multiple table joins.

10. Attack of Clusters


This concept refers to the challenges and vulnerabilities that arise when managing
clusters of distributed databases, including issues of availability, consistency,
and partitioning (CAP theorem).

11. Schemaless Databases in NoSQL


NoSQL databases are schemaless, meaning data doesn’t need a predefined schema,
allowing easy storage of unstructured or semi-structured data. Example: MongoDB can
store documents with different structures in the same collection.

12. Aggregates in NoSQL


Aggregates are groups of related data treated as a single unit for storage and
querying. Consequences of using aggregates include:

Improved Performance: Faster read operations for related data.


Complex Transactions: Harder to handle multi-document transactions.
13. Categories of NoSQL Databases
Key-Value Store: Simple hash table, e.g., Redis.
Document Store: JSON documents, e.g., MongoDB.
Column-Family Store: Column-based storage, e.g., Cassandra.
Graph Store: Nodes and edges for relationships, e.g., Neo4j.
14. Single Server Distributed Model
This model involves distributing tasks across multiple servers to balance load and
ensure high availability.

15. Materialized Views


Materialized views store the results of a query for fast access. Two approaches:

Lazy Approach: Update only when accessed.


Eager Approach: Update in real-time.
16. Data Sharding and Replication
Sharding splits data across multiple servers, while replication stores copies of
data on multiple servers. Combining both ensures high availability and fault
tolerance.

17. Update and Read Consistency


Update Consistency: Ensures that all updates are immediately visible to all clients
(strong consistency).
Read Consistency: Guarantees the same data is read by all clients after updates.
18. Reducing Consistency with CAP Theorem
To increase availability and partition tolerance, systems may choose eventual
consistency over strong consistency, accepting that some data may temporarily be
out-of-sync.

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.

You might also like