SQL vs. NOSQL PDF
SQL vs. NOSQL PDF
Pg # 1
Contents
UNDERSTANDING SQL AND NOSQL DATABASES AND DIFFERENT DATABASE MODELS ........................ 3
INTRODUCTION .......................................................................................................................................................... 3
Pg # 2
Database Models
1. The Relational Model
2. The Model-less (NoSQL) Approach
Pg # 3
longer time, with probably the most predominant choice since the past couple of decades (or even
longer) being the Relational Database Management Systems (RDBMS).
Database Models
Each database system implements a different database model to logically structure the data that is
being managed. These models are the first step and the biggest determiner of how a database
application will work and handle the information it deals with.
There are quite a few different types of database models which clearly and strictly provide the means
of structuring the data, with most popular probably being the Relational Model.
Although the relational model and relational databases are extremely powerful and flexible - when the
programmer knows how to use them, for many, there have been several issues or features that these
solutions never really offered.
Recently, a series of different systems and applications called NoSQL databases started to gain
popularity, expeditiously, with their promise of solving these problems and offering some very
interesting additional functionality. By eradicating the strictly structured data keeping style defined
within the relational model, these DB systems work by offering a much more freely shaped way of
working with information, thus providing a great deal of flexibility and ease -- despite the fact that
they come with their own problems, some serious considering the important and indispensable nature
of data.
Pg # 4
The NoSQL way of structuring the data consists of getting rid of these constraints, hence liberating the
means of keeping, querying, and using information. NoSQL databases, by using an unstructured (or
structured-on-the-go) kind of approach, aim to eliminate the limitations of strict relations, and
offer many different types of ways to keep and work with the data for specific use cases
efficiently (e.g. full-text document storage).
SQLite:
MySQL:
PostgreSQL:
Pg # 5
NoSQL database systems do not come with a model as used (or needed) with structured relational
solutions. There are many implementations with each working very differently and serving a specific
need. These schema-less solutions either allow an unlimited forming of entries, or, a rather an
opposing, very simple but extremely efficient as useful key based value stores.
Unlike traditional relational databases, it is possible to group collections of data together with some
NoSQL databases, such as the MongoDB. These document stores keep each data, together, as a single
collection (i.e. document) in the database. These documents can be represented as singular data
objects, similar to JSON and still be quires depending on attributes.
NoSQL databases do not have a common way to query the data (i.e. similar to SQL of relational
databases) and each solution provides its own query system.
SQL/Relational databases require a structure with defined attributes to hold the data, unlike NoSQL
databases which usually allow free-flow operations.
Querying:
Regardless of their licences, relational databases all implement the SQL standard to a certain degree
and thus, they can be queried using the Structured Query Language (SQL). NoSQL databases, on the
other hand, each implement a unique way to work with the data they manage.
Scaling:
Both solutions are easy to scale vertically (i.e. by increasing system resources). However, being more
modern (and simpler) applications, NoSQL solutions usually offer much easier means to scale
horizontally (i.e. by creating a cluster of multiple machines).
Reliability:
When it comes to data reliability and safe guarantee of performed transactions, SQL databases are still
the better bet.
Support:
Relational database management systems have decades long history. They are extremely popular and
it is very easy to find both free and paid support. If an issue arises, it is therefore much easier to solve
Pg # 6
than recently-popular NoSQL databases -- especially if said solution is complex in nature (e.g.
MongoDB).
By nature, relational databases are the go-to solution for complex querying and data keeping needs.
They are much more efficient and excel in this domain
Pg # 7