Introduction ............................................................................................................................................. 2
Db4o................................................................................................................................................ 7
Applications .......................................................................................................................................... 10
References ............................................................................................................................................. 13
1
Introduction
The fast growth of computer and web cause an issue of effective storage and retrieval of data.
Significant amounts of online transactions and research result in huge amounts of data which
require well-organized storage solutions. A SQL database is a general-purpose relational
database which based on relation tables to store data. A relation table consists of sets of
columns and rows. Each row accounts for a record, and each column represents a field. Tables
can be related and linked to each other with the use of foreign keys or common columns.
Google, Amazon and Facebook are among the main organisations to find the constraints of
SQL database innovation for supporting large data. In this way, the new database is framed to
beat these confinements which are known as NoSQL. A vital component of NoSQL database
which stands out is that they have no schematic structure. Its records can have diverse fields
according to the prerequisites, and this is called as a dynamic pattern. Sharding is another new
component in NoSQL databases which takes Database Partitioning to a more advanced level
as even adaptability and accessibility. The drawbacks of NoSQL databases are the absence of
RDBMS support for end client querying, restricted integrity requirements like a foreign key at
the structure level and limited support for transaction processing.
2
ACID Properties of SQL
SQL databases support ACID in the transaction. ACID (Atomicity, Consistency, Isolation,
and Durability) is database transaction properties. Each of the ACID property is explained in
the context of databases as follows:
Atomicity When there are updates to the database, it should be either abort or commit.
Consistency A transaction either creates a valid and new state of data. All data should
return to its state before the transaction was started if any failure occurs.
Isolation Each transaction must remain isolated, so there is no conflict between
concurrent transactions.
Durability Committed data is saved by the system such that, even when there are a
system failure or system restart, the data is available in its correct state.
BASE is the exact opposite of ACID. The state of data that gets after the transaction is not in
a solid state but in a soft state. The BASE mainly focuses on permanent availability.
3
Types of SQL & NoSQL databases
SQL Databases
4
Vast platform support: It supports numerous operating systems such
as Windows and Linux.
5
NoSQL Databases
A Key-Value Store database is a type of NoSQL databases. It has no fixed schema (Schema-
less). Like the name, the Key-Value database consists of two parts, a string which shows the
key and the actual data which shows the values. The KV databases are like hash tables where
the keys are used as indexes. KV databases are relatively quicker than RDBMS.
Column-Oriented Databases
Data stored in Column-Oriented Databases in the form of the whole column rather than a
row. This decreases the disk access compared to a relational table, which consists of column
and rows with uniform sized fields for every record.
6
Document Store Databases
Document Store Databases saves the data in the form of documents. Document Store
databases are schema-less, so they are much more flexible compared to the records in
relational databases. Format of documents are PDF, XML, JSON etc.
Object-Oriented Databases
Object Oriented databases the data to be stored is represented as an object. Object Oriented
database is a combination of object oriented programming and database characteristics.
Db4o SQL. Db4o allows the user to store an object in a single query. It also
offers db4o Replication System that allows synchronising relational
backend with db4o. The disadvantage of db4o is that there is no built-in
support to export or import data from JSON, XML.
7
Comparison between SQL & NoSQL databases
Schemas and In SQL databases, each record conforms to fixed schematic representation,
Flexibility meaning the columns must be locked before data. In SQL databases, each
record adjusts to settled schematic portrayal, which means the columns
must be chosen and locked before information passage and each line must
contain information for every column. (Ameya N, Anil P, Dikshay P)
Scalability SQL Databases are scalable. RDBMS can be applied across several
servers, but this one of the problematic processes and time-consuming
method. NoSQL databases are parallel accessible, meaning across servers.
These multiple servers can be inexpensive commodity hardware or cloud
instances, making it a lot more cost-effective than vertical scaling. Many
NoSQL databases also distribute data across servers automatically.
ACID The majority of SQL databases are ACID compliant. Differs between
Compliancy technologies, but most NoSQL solutions sacrifice ACID compliance for
performance and scalability.
Type of data to The SQL databases are not suitable for hierarchical data storage. NoSQL
be stored database is comparatively better for the hierarchical data storage as it
follows the key-value pair way of storing data content which is like JSON
data. NoSQL databases are ideal for applications involving big data. An
example is HBase.
For complex SQL databases are a good fit for the complex queries; whereas NoSQL
queries databases are not a good fit for complex queries. On a high-level, NoSQL
does not provide standard interfaces to perform complex queries, and the
NoSQL queries are not as powerful as SQL query language.
For high SQL databases are more suitable for value-based applications. This
transactional because SQL databases are steadier and give the atomicity and also
based uprightness of the information. While it is conceivable to utilise NoSQL
application for exchanges reason yet, it is as yet not practically available and efficient
in high load and complex transactional applications.
Data Data manipulation activities in SQL databases is done by using Selection,
manipulation Insertion, and Update statements, e.g. SELECT column_name FROM
8
table_name WHERE condition In NoSQL databases, data manipulation
is done using different object-oriented APIs.
9
Applications
NOSQL databases are most widely used in online applications. It is still no much used in
standalone database applications. There is some organised way needs to be implemented for
NOSQL databases so that it can completely ready to replace RDBMS. SQL databases can be
used for all types of applications. However, the performance may vary according to the amount
of data stored. (digitalocean.com, 2017)
SQL NoSQL
Stores data in table form Stores related data in JSON-like,
Schema is required to defines tables name-value documents
(www.sitepoint.com) Can store data without specifying
Encourages normalisation to reduce data a schema
redundancy Should not require join operations
Provides transactions to guarantee two (presuming denormalized
or more updates succeed or fail as an documents are used)
atomic unit Permits any data to be saved
Supports table joins to retrieve data from anywhere at any time without any
multiple tables in a single command verification
Implements data integrity rules Guarantees updates to a single
Has a tendency to come grinding to a document but not multiple
halt if its forced to deal with too many documents
operations at a given time. Provides excellent performance
Have lots of talented developers and scalability
throughout the market and in every field Because NoSQL databases are
of trade. still new, nearly every NoSQL
developers are still in the process
of mastering the technique.
10
Testing SQL and NoSQL databases
SQL Testing
NoSQL Testing
NoSQLUNit which is a JUnit extension that able to connect with a broad range of NoSQL
databases like Cassandra, MongoDB, Redis and more. It also enables you to load the test data
before the test execution and compare the data sets after the test execution with few lines of
code. (blog.codecentric.de, 2017)
11
Example of SQL and NoSQL queries
12
References
International Journal of Science & Engineering Research, Modeling and Querying Data in
MongoDB by Rupali Arora, Rinkle Rani Aggarwal SQL vs. NoSQL Databases Differences
Explained with few Examples DB by LUKE P. ISSAC on JANUARY 14,2014.
Issac, L.P., 2014, SQL vs. NoSQL Database Differences Explained with few Example DB
[Online]. Available at: http://www.thegeekstuff.com/2014/01/sql-vs-nosql-db/ [Accessed: 1
July 2017].
Anon, 2015, Difference between SQL and NoSQL: A Comparison [Online]. Available at:
http://www.thewindowsclub.com/difference-sql-nosql-comparision [Accessed: 3 July 2017].
Anon, Database Testing: How to Regression Test a Relational Database [Online]. Available
at: http://www.agiledata.org/essays/databaseTesting.html [Accessed: 3 July 2017].
13
Anon, 2014, Test Automation for NoSQL Databases with NoSQL Unit and Travis-CI
[Online]. Available at: https://blog.codecentric.de/en/2014/05/nosql-test-automation-
nosqlunit-travis-ci/ [Accessed: 3 July 2017].
Anon, 2015, Advantages and Disadvantages of NoSQL databases what you should know
[Online]. Available at: http://www.hadoop360.datasciencecentral.com/blog/advantages-and-
disadvantages-of-nosql-databases-what-you-should-k [Accessed: 3 July 2017].
14