Reserch SQL
Reserch SQL
Study
By Sanjana
24MCA20247
The rise of data-driven applications has led to an MySQL: Open-source relational database,
increasing need for robust database management widely used for web applications.
systems (DBMS) to store, manage, and retrieve vast PostgreSQL: Known for its robustness,
amounts of structured, semi-structured, and support for complex queries, and extensions.
unstructured data. Two prominent types of databases
dominate the landscape: SQL (relational databases) Oracle: A powerful enterprise-grade relational
and NoSQL (non-relational databases). database used in large-scale applications.
While SQL databases have been the standard for Microsoft SQL Server: A SQL database
decades, NoSQL databases have gained popularity favored for integration with Windows
due to their scalability, flexibility, and ability to and .NET environments.
handle large-scale distributed data. The objective of
this paper is to conduct a comparative study of SQL 3. Overview of NoSQL Databases
and NoSQL databases by examining their
architectures, strengths, limitations, and use cases. 3.1 Definition and Structure
2. Overview of SQL Databases NoSQL databases are designed to store and manage
large volumes of unstructured or semi-structured data.
2.1 Definition and Structure Unlike SQL databases, they do not rely on predefined
schemas and offer flexibility in data modelling.
SQL databases, also known as relational databases,
NoSQL databases are classified into several types
store data in structured tables with predefined
based on their underlying data model, including
schemas. Data is organized into rows and columns, document, key-value, column-family, and graph
with relationships between tables managed through databases.
primary and foreign keys.
2.2 Characteristics
ACID Transactions: SQL databases ensure data
3.2 Characteristics
integrity through ACID (Atomicity, Consistency,
Isolation, Durability) properties, which guarantee
Scalability: NoSQL databases excel at
reliability during data transactions horizontal scaling, allowing data to be
Schema-based: SQL databases enforce rigid distributed across multiple servers.
schemas that define the structure of data Flexibility: Schemaless design allows for the
before insertion, ensuring data consistency. storage of data without a predefined structure,
making NoSQL ideal for evolving
Relational Model: SQL databases represent
applications.
relationships between data points explicitly
through joins and foreign keys. Eventual Consistency: Many NoSQL
databases prioritize availability over
2.3 Common SQL Databases consistency, offering eventual consistency
instead of strong ACID guarantees.
1
3.3 Common NoSQL Databases NoSQL Databases: Often provide eventual
consistency and BASE (Basically Available,
Popular NoSQL databases include: Soft state, Eventual consistency) transactions.
NoSQL databases prioritize availability and
MongoDB: A document-based database scalability over strict consistency, suitable for
known for its flexibility in handling semi- large-scale web applications.
structured data.
4.4 Scalability
Cassandra: A column-family database
designed for high availability and fault SQL Databases: Traditionally scale vertically
tolerance. by upgrading the server’s hardware (e.g., more
Redis: A key-value store optimized for real- RAM or CPU). While some SQL databases
time data processing and caching. support horizontal scaling through sharding, it
is not as seamless as in NoSQL databases.
Neo4j: A graph database used to model and
query highly connected data. NoSQL Databases: Designed for horizontal
scaling, allowing them to distribute data across
4. Key Differences between SQL and NoSQL multiple servers or nodes in a cluster. This
Databases makes NoSQL databases better suited for
handling large-scale distributed applications.
4.1 Data Model
NoSQL Databases: Do not enforce a strict SQL: Optimized for complex queries and
schema. Documents or key-value pairs can joins but can experience performance
store varying types and formats of data, bottlenecks with very large datasets, especially
making NoSQL suitable for dynamic or when dealing with frequent JOIN operations.
evolving data models. NoSQL: Optimized for fast read/write
operations across distributed systems. NoSQL
4.3 Transactions and Consistency databases excel in situations where simple
queries or key-based lookups dominate the
SQL Databases: Ensure strong consistency workload.
and support ACID transactions, making them
ideal for applications that require reliable, 5.2 Flexibility in Scaling
transactional processing (e.g., financial
systems). SQL: Vertical scaling has limitations due to
hardware constraints. Horizontal scaling is
2
possible but requires complex sharding 7. Advantages and Limitations
mechanisms that are difficult to implement
and manage. 7.1 Advantages of SQL
NoSQL: Naturally supports horizontal scaling
across commodity hardware, making it easier Data Integrity: Strong consistency and
to manage and grow as data and load increase. support for ACID transactions ensure data
reliability.
5.3 Availability and Fault Tolerance Complex Queries: SQL’s mature query
language supports advanced operations,
SQL: Ensures strong consistency but may including aggregation, filtering, and joining
compromise availability, especially during across multiple tables.
failover scenarios. Replication and failover Mature Ecosystem: SQL databases have been
strategies exist, but they are more complex. around for decades, with a wide range of tools,
NoSQL: Prioritizes availability and partition extensions, and community support.
tolerance (as per the CAP theorem), ensuring
that systems remain operational even when 7.2 Limitations of SQL
some nodes fail or become unreachable. This
makes NoSQL ideal for distributed, fault- Limited Scalability: Scaling relational
tolerant systems. databases horizontally is challenging and often
requires complex techniques like sharding.
Rigid Schema: The need for a predefined
schema makes SQL databases less flexible
6. Use Cases of SQL and NoSQL Databases when dealing with changing data models.
9. Conclusion
In conclusion, SQL and NoSQL databases each 4. Redmond, Eric, and Jim R. Wilson. Seven
offer unique advantages and trade-offs. SQL Databases in Seven Weeks: A Guide to
databases are best suited for applications that Modern Databases and the NoSQL Movement.
require transactional integrity, complex queries, Pragmatic Bookshelf, 2018.
and a predefined schema, while NoSQL databases
excel in applications where scalability, flexibility,
and performance are prioritized over consistency.
As the data landscape evolves, the choice between 5. Vogels, Werner. Eventually Consistent. ACM
SQL and NoSQL will depend on the specific Queue, 2009.
requirements of the application, including the
need for scalability, data consistency, and
flexibility.
6. Sadalage, P. J., & Fowler, M. NoSQL
Distilled: A Brief Guide to the Emerging
World of Polyglot Persistence. Addison-
Wesley, 2012.
10. References
4
5