0% found this document useful (0 votes)
11 views5 pages

Nosql

The document discusses the value of relational databases, highlighting their persistence, concurrency, integration, standardization, and security. It also explains concepts like impedance mismatch, various NoSQL data models (key-value, document, column-family), and graph databases, along with differences between SQL and NoSQL databases. Additionally, it covers database configurations such as single server, sharding, master-slave replication, and the combination of sharding and replication for scalability and availability.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

Nosql

The document discusses the value of relational databases, highlighting their persistence, concurrency, integration, standardization, and security. It also explains concepts like impedance mismatch, various NoSQL data models (key-value, document, column-family), and graph databases, along with differences between SQL and NoSQL databases. Additionally, it covers database configurations such as single server, sharding, master-slave replication, and the combination of sharding and replication for scalability and availability.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Module 1: Important Questions for IA-1

1. Briefly describe the value of Relational databases .


Relational databases (RDBMS) have been the dominant choice for data storage due
to their ability to handle persistent data, support concurrent user access, and
facilitate data integration. They use structured schemas, which make it easy to
manage and query data using SQL (Structured Query Language). Key benefits
include:
o Persistence: They allow long-term storage of data that survives crashes or
reboots.
o Concurrency: They manage simultaneous access by multiple users through
transactions, preventing conflicts like double-booking.
o Integration: A shared database can be accessed by multiple applications,
providing consistency and centralized control.
o Standardization: The (mostly) standard model makes relational databases
easy to adopt, with widespread knowledge of SQL among developers.
o Security and Data Integrity: Transactions ensure data consistency, while
various layers of access control enhance security.
2. Explain briefly about impedance mismatch, with a neat diagram.
Impedance mismatch occurs when the relational model (tables and rows) used by
databases differs from the in-memory data structures (like objects) used in
applications. In relational databases, data is stored in tables with fixed schemas, but
applications often need to work with complex, hierarchical objects, which leads to a
disconnect. Developers use Object-Relational Mapping (ORM) tools to map
between these structures, but this can introduce complexity and performance issues.
The mismatch often leads to difficulties in query optimization and higher complexity
in code.
3. Write short notes on:
a. Key-value data model:
o The key-value model is the simplest NoSQL model, where data is stored as
pairs of unique keys and values. It is highly efficient for simple lookups based
on keys but lacks advanced querying capabilities. This model is used in
systems like Redis and is ideal for scenarios like caching.
b. Document data model:
o In a document data model, data is stored in semi-structured formats like JSON
or XML. This model allows hierarchical data storage, enabling fields and
nested structures. Documents are more flexible and can be queried by internal
fields, making this model suitable for applications like MongoDB.
c. Column family stores:
o Column family stores organize data into rows, but each row can have a
flexible number of columns grouped into families. This model is ideal for
handling large-scale data and is used by systems like Cassandra. The data
structure supports efficient read and write operations for analytical queries.
4. Explain about graph database, with a neat diagram
Graph databases store data as nodes (entities) and edges (relationships). They are
optimized for querying data with complex interconnections, such as social networks
or recommendation engines. Unlike relational databases, where relationships are
handled by joins, graph databases store relationships directly, making them more
efficient for traversing data.
5. Difference between SQL (Relational) and NoSQL DB (5 Marks):

Criteria SQL (Relational) NoSQL (Non-relational)

Stores data in various formats: key-


Data Structured in tables with rows
value, document, column-family, or
Structure and columns.
graph.

Fixed schema, data must Dynamic schema, flexible data


Schema
conform to predefined structure. formats.

No standard language; depends on


Query SQL (Structured Query
the database (e.g., MongoDB uses
Language Language).
queries in JSON).

Vertical scaling (adding more Horizontal scaling (adding more


Scaling
power to a single server). servers).

Follows ACID properties Often follows BASE (Basically


Consistency (Atomicity, Consistency, Available, Soft state, Eventual
Isolation, Durability). consistency).

Module 2: Important Questions for IA-1


1. Single server :
o In a single server configuration, the entire database is run on a single
machine. This approach is simple and easy to manage but limits scalability. It
is suitable for applications with low data volumes where scaling is not a
concern. A single server handles both read and write operations, which can
become a bottleneck as the application grows.
2. Sharding (5 Marks):
o Sharding is a technique used to partition a large dataset horizontally across
multiple servers (shards). Each shard contains a portion of the data, which
improves scalability by distributing the load of read and write operations.
Sharding ensures that the system can handle large amounts of data and traffic
by splitting data logically (e.g., by user ID or region). However, sharding adds
complexity to managing data consistency acros shards.

3. Master-slave replication (5 Marks):


o Master-slave replication involves a master server that handles all write
operations and one or more slave servers that replicate the master's data and
handle read requests. This model improves read scalability and provides
redundancy in case the master fails. However, if the master goes down, no
write operations can be performed until the master is restored or a new one is
appointed.
4. Combining sharding and replication (5 Marks):
o Combining sharding and replication helps achieve both scalability and high
availability. In this model, data is first sharded across multiple servers, and
each shard is then replicated across multiple machines. This ensures that the
system can handle large datasets and distribute the load efficiently, while also
providing data redundancy to prevent data loss in case of server failure.

You might also like