Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
SQL OR NoSQL DATABASES? CRITICAL DIFFERENCES.pdf
1. Annals of the „Constantin Brâncuşi” University of Târgu Jiu, Economy Series, Issue 1/2021
„ACADEMICA BRÂNCUŞI” PUBLISHER, ISSN 2344 – 3685/ISSN-L 1844 - 7007
SQL OR NoSQL DATABASES? CRITICAL DIFFERENCES
ANA-GABRIELA BABUCEA
PROF. PHD., “CONSTANTIN BRANCUSI” UNIVERSITY OF TARGU JIU,
e-mail: gabibabucea@gmail.com
Abstract
The recent years, marked by an unprecedented increase in the volume of data stored and managed, have
simultaneously brought many problems and difficulties regarding the adequate management systems of very large
databases, especially the traditional ones, most of them dedicated to relational databases, which are rather oriented
towards ensuring data integrity and transaction coherence. The solution to this problem was a new database model,
called NoSQL, an emerging alternative to the traditional relational databases, a popular choice especially due to
applications in web requirements. NoSQL databases are not only simple replacements for SQL databases, they usually
co-exist due to their complements. SQL databases are currently facing many challenges such as scalability and agility
proving the inability to adapt to currently available facilities like cheap memory and processing power, while the
NoSQL databases are increasingly proving their ability to handle very large volumes of stored data in terms of the
number of users. Thus, following the same major objective, as the creation, recovery, updating, and management of
data, two complementary database models are currently used, both with pros and cons. This paper aims to be a review
of the benefits and limits of NoSQL over the relational highlight by recent literature on the subject.
Keywords: Databases, relational databases, NoSQL databases
Classification JEL: L8
1. Introduction
In recent years, marked by the digital transformation of organizations with the need for
storage and management of increased volumes of data characterized by its no uniformity (Big Data)
and real-time applications, for a large number of users, increase the popularity of NoSQL databases
is gained as an important alternative to relational databases mainly because of their scalability, high
performant, and flexibility in nature. [1-3]
The necessities of software applications have changed due to the advancements in distributed
web applications and cloud computing and have particular needs from their databases. [3]
Thus, the database solutions must be responsible for high availability, scalability, and at the
same time satisfying the non-uniformity of data. For these is needed a quick transform of the type
of relationships between data. Semi-structured data, unstructured, or even polymorphic data proved
their much more flexible than structured data and so, are much usefully. RDBMS might do
compromises to effective storage of unstructured and semi-structured data, and that means
complexity by involving a larger number of ITC workers for converting such data into relational
data before storage. So, by storage them directly, in a non-relational database, in their natural form,
a small and agile team of developers an offer software applications that could by provide
distributed or as a service in the cloud, published on the web, and delivered to thousands of users,
from many organizations.
The relational model, invented by E.F. Codd at IBM in 1970, has been for a long time, the
primary choice for storage and managed data due to their ease and flexibility of RDBMS. SQL
(Structured Query Language) m related data from a relational database. In fact, SQL databases
were aimed to organize and structure any type of data. [2]
In all this time, almost all activities have been used data structures based on relational
database theory because of its simplicity. But, the relational model proved to have a real problem
53
2. Annals of the „Constantin Brâncuşi” University of Târgu Jiu, Economy Series, Issue 1/2021
„ACADEMICA BRÂNCUŞI” PUBLISHER, ISSN 2344 – 3685/ISSN-L 1844 - 7007
regarding keeping its performances in storing data with rapidly increasing volumes. Thus, a new
data model i.e. NoSQL, was developed as a solution to the relational model’s limitations.
Practically, the NoSQL databases appeared and developed along with the Internet era and can
be considered a reaction to the incapacity of SQL databases to assurance all the requirements of
web-scale applications that must manipulate more and more data.
Theoretically, the concept of NoSQL was existed for a long time ago, but it becomes
practically used as the database as a service (DBaaS) and so it obtain evident recognition [4], with
every passing year the NoSQL is attaining larger and larger attractiveness. This is because, unlike
the relational databases, the goal of NoSQL databases was to be able to be expanded without
problems [4, 5] In other words, NoSQL databases are proper for the management of large data of
various natures and marked by permanent changes. [6]
The label of NoSQL is dated in 1998 when Carlo Strozzi choose it for named a database that
is not managed by using SQL. Even if, NoSQL databases initially referred to a “Not SQL” or
“Non-relational”, it is necessary to specify that in reality, Strozzi’s NoSQL database employed the
relational model, its file name NoSQL only reveals the fact that it does not use Structured Query
Language for its queries. [7] The term NoSQL has a new understanding after the developers'
meetup organized by Johan Oskarsson in 2009 when were discussed the expansion of “open-
source, distributed, and non-relational databases”. Since that meeting, “NoSQL” has been used to
name any database that doesn’t employ the relational model, and it is meaning that it doesn’t fit
with the original label of the NoSQL database. [8]
Several operational data models are developed and are associated with this concept of
NoSQL, from 2009. But, their particular applications have shown that not all NoSQL databases
work better than SQL databases in all conditions. In some situations, non-relational databases can
produce worse results than SQL, so the performance of the two data storage and management
strategies depends on data operations. These may be faster or slower in data selection, reading,
editing, or deleting operations, as appropriate. Both SQL and NoSQL have advantages and
disadvantages. [1]
Thus, in this paper was considered the particularity of NoSQL databases of not be structured
as tables, a non-relational form of data management which no possess tabular relationships. Based
on a large literature on the topic, we aimed to highlight the NoSQL databases' benefits and limits
against the structured ones.
2. SQL and NoSQL databases - particularities
The main aspect that differentiates these two systems, relational (SQL) and non-relational
(NoSql), is the way that the data are structured. A relational database table organizes structured
data fields into defined columns. A non-relational database does not incorporate the table model.
Instead, data can be stored in a single document file. Documents of a NoSql database are JSON
(JavaScript Object Notation) documents, complete entities that can be easily read and understand.
2.1. SQL databases and DBMS'
Even if, the particularity of the relational database managed by traditional relational DBMS
is to assure the integrity of data and the consistency of transactions, the main reason for still
remaining popular, is that SQL, the programming language widely supported to design relational
databases is a lightweight, declarative language, that can assurance a lot of heavy tasks under the
relational database. By using a single command with a simple-yet-powerful JOIN clause,
developers can retrieve related data from multiple tables.
From another point of view, several familiar SQL databases and DBMS' are still proper for
the current requirements of the different types of users [9] like:
54
3. Annals of the „Constantin Brâncuşi” University of Târgu Jiu, Economy Series, Issue 1/2021
„ACADEMICA BRÂNCUŞI” PUBLISHER, ISSN 2344 – 3685/ISSN-L 1844 - 7007
- MySQL, considered the most popular open-source database, is excellent for CMS (Content
Management Systems) sites and blogs;
- Oracle, an object-relational DBMS, offers a full-services option and great reliability.
- IMB DB2, from IBM, built to advanced “big data” analytics;
- Sybase, a business relational model database server product specifically to the Unix OS;
- MS SQL Server, an RDBMS developed by Microsoft for enterprise-level databases
supporting both SQL and NoSQL;
- Microsoft Azure, a cloud computing platform that offers storing, computing, and scaling
data in a single place for any operating system;
- MariaDB, a new drop-in version of MySQL, open-source software under the GNU General
Public License. Maintaining high compatibility with MySQL, MariaDB offers many new
diverge features;
- PostgreSQL, an object-relational DBMS for enterprise-level, offers the possibility of using
both SQL-level code and procedural languages like Python or Perl.
But, a relational database is a much more rigid, structured way of storing data because the
database schema must be defined very clear before adding the data. A relational database is very
effective when the stored data are very structured and well organized. Thus, such as a well-
designed schema minimize the data redundancy, a poorly-designed schema can result in its rigidity.
But, an excellent organization involves a compromise in flexibility for a relational database.
2.2. NoSQL databases and DBMS'
NoSQL database is a non-tabular database, and as a consequence, there’s a common
misconception that NoSQL databases do not hold relationship data well. In reality, a NoSQL
database appears more like a file folder that can assemble related data of all types in various
flexible forms due to not need to predefine a schema. [9]
Because of that, can simply create relationships of data, but differently from SQL database
do. This is considered an advantage of SQL databases because is not necessary to split the
correlated data between tables, due to the possibility of nested them within a single data structure.
With NoSQL database models it is not necessary to build a complex data model, as SQL
needs to ensure the reduction of data duplication and all other relational model constraints. A
NoSQL database is proper when the requirements aren’t very clear at the outset or there are
massive amounts of unstructured data, conditions that limit the development of a relational
database with a clearly defined schema. With data having a no-predefined scheme, the NoSQL is
databases more flexible, and this in the conditions in which relationships between data are kept, but
in a different way from than the SQL databases do.
This approach allows developers to focus on software application development and database
optimization. The software applications proved that “are not so often interested in in-database
aggregation and able to control, at least in many cases, integrity and validity themselves”1
.
However, a NoSQL database can have various schemas, based on different models that store data
in a different format than relational tables, but with easy scalability to a large quantity of data and a
high number of users, too. So, the major advantage of a NoSQL solution (open-source or no) is the
assurance of better scalability and global performance.
Historically, there are five types of NoSQL considered by particular data storage model
evolution: [4, 9-12]
- Key-value model - as the first NoSQL model, it is the least complex. The data are stored
in a schema-less technique, by indexed keys and values. Someway, a key-value store
1
Katsov I., Nosql data modeling techniques, Available at
https://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/
55
4. Annals of the „Constantin Brâncuşi” University of Târgu Jiu, Economy Series, Issue 1/2021
„ACADEMICA BRÂNCUŞI” PUBLISHER, ISSN 2344 – 3685/ISSN-L 1844 - 7007
can be considered a relational database with only two columns: the key or attribute name
and the value. Such a database model is generally proper for storing session information
including shopping carts data, user preferences, and user profiles.
- Wide column store - data is stored in the form of sections of columns of data big-table
style databases. It seems an inverted table because stores data tables as columns rather
than rows and so have the advantage of best scalability and efficiency. The column
databases model is indicated for content management systems, blogging platforms,
sustaining counters, weighty write volume, and more others;
- Document databases - the higher type of key-value stores. Specifically, is the values
saved as documents which are data in the form of complex structures. The document is
the main concept in this type of NoSQL databases model. It’s the primary option for
storing and manipulating document-oriented data which can be XML, JSON, binary
JSON (BSON), and more others, which are still structured somehow. Document
databases are typically used for e-commerce applications, but also for blogging
platforms, content management systems, as well as for web analytics.
- Graph databases - based on graph theory, this method offers lots of complexity
particularly when the data are interconnected and have the best representation as a
graph. This NoSql database model allows storing entities and relationships between
them. Entities are called nodes, which have properties. The graph organization permits
stored the data only once and interpreted them in different modes based on relationships.
It is good for social networks, routing information for goods and money, spatial data,
approval engines;
- XML databases (also named “Native XML Databases” or even “Native XML DBMS”)
– a kind of document-oriented database proper for a huge volume of data stored in the
XML format.
Several DBMS products are popular for each kind of NoSql database model, several multi-
model, but the databases are not the same, and there are major differences between them, offering
different performance. [4, 12-14] In table no. 2 are presented the most widely used such systems,
some of them multi-model.
Table no. 1 Main NoSQL databases and DBMS by NoSQL databases models, January 2021
NoSQL database
models
DBMSs in ranking Top 10 DBMSs
Key-value model
62 systems (including
22 multi-model)
Redis, Amazon DynamoDB (not open-source), Microsoft
Azure Cosmos DB, MemcacheDB, Hazelcast, etcd,
Ehcache, Aerospike, Riak KV, OrientDB
Wide column store
13 systems (including
6 multi-model)
Cassandra, HBase, Microsoft Azure Cosmos DB, Datastax
Enterprise, Microsoft Azure Table Storage, Accumulo,
Google Cloud Big Table, ScyllaDB, HPE Ezmeral Data
Fabric, Ellasandra
Document database
51 systems (including
24 multi-model)
MongoDB, Amazon DynamoDB, Microsoft Azure
Cosmos DB, Couchbase, CouchDB, Firebase Realtime
Database, MarkLogic, RealM, Google Cloud Firestone,
OrientDB
Graph database
32 systems (including
16 multi-model)
Neo4J, Microsoft Azure Cosmos DB, OrientDB,
ArangoDB, JanusGraph, Amazone Neptune, Virtuoso,
GraphDB, FaunaDB, Dgraph
XML databases
7 systems (4 multi-
model)
MarkLogic, Oracle Berkeley DB, Virtuoso, BaseX,
Sedna, eXist-db, searchxml
Source: https://db-engines.com/en/ranking [15], accessed on Jnuary 07, 2021.
56
5. Annals of the „Constantin Brâncuşi” University of Târgu Jiu, Economy Series, Issue 1/2021
„ACADEMICA BRÂNCUŞI” PUBLISHER, ISSN 2344 – 3685/ISSN-L 1844 - 7007
3. SQL and NoSQL databases – Critical differences and limitations
Because of their particularities, the two database systems relational (SQL) and non-
relational (NoSQL), have many differences between them. Every difference becomes very
important when a decision must be taken for choosing the best DBMS for an organization.
An essential main difference between them is the language. SQL databases use Structured
Query Language for defining and manipulating data. SQL is widely used, but restrictive. Because
such a language apriori needs predefined schemas to determine the structure of stored data, it can
involve a careful execution and, more than that, a significant in advance preparation. In front of
this, a NoSQL database involves a dynamic schema for unstructured data that can be stored in
several different ways, (key-value store, column-oriented, document-oriented, graph-based, or
organized as an XML) which is extreme flexibility, and not need having to meticulously plan to
define the structure of the database. Also, each document can have own structure, a unique one, and
this means more freedom overall.
Another critical difference between them is their scalability. While the SQL databases are
vertically scalable, which means that accept to increase the load on a single server by growing
components such as RAM, SSD, or even CPU, the NoSQL databases are horizontally scalable, and
that means that can support increased traffic only by adding other servers. So, the NoSQL
databases are better solutions, especially for large or constantly evolving data sets due to their
ability to become much more powerful by expanding them.
Not least, an important difference that can be considered in arguments SQL versus NoSQL
regards their structures. While SQL databases are table-based which makes them a better option for
applications with multi-row transactions, NoSQL databases can be one of the various models like
key-value pairs, wide-column stores, graph databases, or maybe document-based and XML, and so,
better for unstructured data like documents or JSON.
Table no. 2 Critical differences between SQL and NoSQL databases models
Type of
database
Properties
SQL NoSQL
Structure of database - Table-based Databases
- Key-Value Store Databases
- Wide Column Databases
- Document Store Databases,
- Graph databases
- XML Databases
Flexibility of schema - Predefined schema - Dynamic schema
Scalability of data - Vertically scalable (Hardware) - Horizontally scalable (server)
Way of defining and
manipulating the data
- SQL - Focused on the collection of documents
Performance of Queries
- Ideal for complex queries - Not ideal for complex queries
Guaranteed properties
- Atomicity, Consistency, Isolation,
and Durability (ACID principles)
- Basically available, Soft state, Eventual
consistency (BASE properties), in
compliance with CAP*
*CAP theorem explains the limitation of all databases regarding the possibility of picking only two of the
three characteristics named as CAP (C - Consistency, A - Availability, and P - Partition tolerance)
57
6. Annals of the „Constantin Brâncuşi” University of Târgu Jiu, Economy Series, Issue 1/2021
„ACADEMICA BRÂNCUŞI” PUBLISHER, ISSN 2344 – 3685/ISSN-L 1844 - 7007
Even if NoSQLs present several major disadvantages in front of relational DBMS like the
lack of a standard query language and a standard interface, or difficult maintenance, the real
advantages are evident if we consider the wide range of data models developed at a high pace,
easily scalable, more flexible, faster, and more efficient than the RDBMSs and not in the lastest
with no requirement regarding the database administrators. [4]
Beyond the global advantages of NoSQL databases over SQL ones in terms of their non-
functional characteristics such as data scalability, scheme flexibility, the potential for storing and
manipulating all types of data, not necessarily structured and data query performance presented in
table no. 2, both the literature in the subject and practicing IT specialists claim limitations in
application of functional features (i.e. de-normalization, single aggregate, atomicity, unordered
keys, derived table, composite key, composite aggregation, aggregation, aggregation and group by,
adjacency lists, nested sets and joins), in particular type and implementation of NoSQL. [3]
Knowing the particularities and limits of these models allows the correct decision regarding the
design principles of distributed database systems: data model, consistency model, data partitioning,
and the CAP theorem, the still existing claims in developing effective NoSQL databases need
carefulness in design and manage. [16]
4. Conclusions
It is a fact that the NoSQL developers’ community is not as large as the SQL community,
yet. The last one, much older, consists of many experts who share their longtime knowledge and
best practices and continuously enhancing their abilities and skills, so it is expected that SQL
databases continue to survive as the first option for a long time to come. On the other hand, the
NoSQL community has grown rapidly, especially in the last years, due to the current Internet
technologies that force, in a way, the companies to find new solutions for their DBMS for saving
money, and NoSQL technology can do this better in comparison to managing a relational database.
The major advantages of NoSQL databases regard primarily their abilities of easy
management of the Bigdata with changeable data, on a dynamic development by using object-
oriented programming. At the same time, all that involves the advantage of expandability of
NoSQL databases, due to their easy and efficient implementation described by a horizontally
scalable architecture. It can be added, too, the advantage of their open-source for no cost solutions.
But, even with all remarkable benefits, must remark that at the moment, there is no general and
optimal choice between relational and NoSQL databases. Different applicable features for each of
them being more or less proper in particular situations. Having in mind all NoSQL database
facilities and limits can not say that the demise of RDBMS databases will be soon. In fact, the
current content of the term NoSQL tends to refer rather to an ecosystem of “Not only SQL”
databases, therefore including SQL ones, similar with the term “polyglot persistence” which
describes the variouse technologies that permit different demands of data storage.
6. Bibliography
[1] Li, Y., Manoharan, S., A performance comparison of SQL and NoSQL databases. In 2013
IEEE Pacific Rim Conference on Communications, Computers and Signal Processing
(PACRIM), pp. 15-19, 2013. Available at
https://www.researchgate.net/publication/261079289_A_performance_comparison_of_SQL_and_NoSQL_databases
[2] Agarwal, S., Rajan, K.S., Analyzing the performance of NoSQL vs. SQL databases for Spatial
and Aggregate queries, Free and Open Source Software for Geospatial (FOSS4G) Conference
Proceedings. 2017, p. 4. Available at https://scholarworks.umass.edu/foss4g/vol17/iss1/4/;
58
7. Annals of the „Constantin Brâncuşi” University of Târgu Jiu, Economy Series, Issue 1/2021
„ACADEMICA BRÂNCUŞI” PUBLISHER, ISSN 2344 – 3685/ISSN-L 1844 - 7007
[3] Gupta, A., Tyagi, S., Panwar, N., Sachdeva, S., & Saxena, U., NoSQL databases: Critical
analysis and comparison. In 2017 International Conference on Computing and Communication
Technologies for Smart Nation (IC3TSN) pp. 293-299, IEEE, 2017. Available at
https://www.researchgate.net/publication/323057709_NoSQL_databases_Critical_analysis_and_co
mparison;
[4] Nayak, A., Poriya, A., Poojary, D., Type of NOSQL databases and its comparison with
relational databases. International Journal of Applied Information Systems, 5.4: 16-19, 2013. At
https://www.academia.edu/7432958/Type_of_NOSQL_Databases_and_its_Comparison_with_Relational_Databases
[5] Alotaibi, O., Pardede, E, Transformation of Schema from Relational Database (RDB) to
NoSQL Databases. Data, 2019, 4.4: 148. Available t https://www.mdpi.com/2306-5729/4/4/148 ;
[6] Lakshman, A., Malik, P. Cassandra - A Decentralized Structured Storage System, Operating
Systems Review, 2010. Available https://dl.acm.org/doi/10.1145/1773912.1773922;
[7] Strozzi, C. NoSQL- A Relational Database Management System, NoSQL: a non-SQL RDMS.
http://www.strozzi.it/cgi-bin/CSA/tw7/I/en_US/nosql/Home%20Page;
[8] Drake, M. A Comparison of NoSQL Database Management Systems and Models, 2019,
Avilable at https://www.digitalocean.com/community/tutorials/a-comparison-of-nosql-database-
management-systems-and-models;
[9] Wodehouse, C. - SQL vs. NoSQL Databases: What’s the Difference?, Available at
https://www.upwork.com/resources/sql-vs-nosql-databases-whats-the-difference;
[10] Katsov I., Nosql data modeling techniques, 2012, Available at
https://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/;
[11] Sharma, N., Jain, C., Chauhan, M. Comparative study of distributed, scalable, & high
performance NoSQL databases. International Journal in IT & Engineering, 3(1), 28-35, 2015.
Available at http://bbrc.in/bbrc/a-comparative-study-of-nosql-databases/;
[12] Sadalage, P. NoSQL Databases: An Overview, Data Science & EngineeringTechnology,
2014, Available at https://www.thoughtworks.com/insights/blog/nosql-databases-overview;
[13] Martins, P., Abbasi, M., SÁ, F. A study over NoSQL performance. In: World Conference on
Information Systems and Technologies. Springer, Cham, 2019. p. 603-611.
[14] Diogo, M., Cabral, B., Bernardino, J. Consistency Models of NoSQL Databases. Future
Internet, 11(2), 43, 2019;
[15] *** https://db-engines.com/en/ranking;
[16] Davoudian, A., Chen, L., Liu, M. A survey on NoSQL stores. ACM Computing Surveys
(CSUR), 51(2), 1-43, 2018, Avalilable at https://link.springer.com/chapter/10.1007/978-3-030-
16181-1_57;
[17] Babucea, A.G. Main benefits and limitations of nosql databases, Proceedings of the
International Scientific Conference ECOTREND 2020 - ”Effects of economic activity shutdown
during the Coronavirus pandemic”, XVII th Edition, December 11-12, 2020, Academica Brancusi,
Târgu Jiu, pp. 251-254, 2020.
ACKNOWLEDGMENT: This work is partially based on the paper “Main benefits and limitations
of NoSQL databases”, presented by the author in International Scientific Conference ECOTREND
2020, XVIIth Edition, with the theme “Effects of economic activity shutdown during the
Coronavirus pandemic”, organized by Faculty of Economics (FSE), in collaboration with Center of
Fundamental and Applied Economic Studies (CSEFA), "Constantin Brancusi" University of Targu-
Jiu, December, 11-12, 2020.
59
8. Copyright of Annals of 'Constantin Brancusi' University of Targu-Jiu. Economy Series is the
property of Universitatea Constantin Brancusi din Targu-Jiu and its content may not be
copied or emailed to multiple sites or posted to a listserv without the copyright holder's
express written permission. However, users may print, download, or email articles for
individual use.