Relational Database Vs Non-Relational Database
From the past few years NoSQL or Non-relational database tools have gained much popularity in terms of storing vast amount of data and scaling them easily. There are debates on whether non-relational databases will replace relational databases in future. With the growing number of social data and other unstructured data, the following are some of the questions raised on relational databases.
Are relational databases skilled of handling big data?
Are relational databases able to scale out enormous amount of data?
Are relational databases suited for the modern age data?
Well, before getting answers to those questions, let us dive deep-in and know some basics of both Relational and Non-Relational databases.
The theory of Relational Database was developed in 1970s. The most important feature of all relational databases is its support of ACID (Automicity, Consistency, Isolation, and Durability) properties which promises that all the transactions are reliably processed.
Automicity: Each transaction is unique and make sure that if one logical part of a transaction fails everything is roll backed so that data is unchanged.
Consistency: All data written in the database are subjected to the rules defined.
Isolation: Changes made in a transaction are not noticeable to other transactions until they are committed.
Durability: Changes committed in a transaction are stored and available in the database even if there is power failure or the database goes offline suddenly.
The objects in the relational databases are structurally structured. The data in the table are stowed as rows and columns. Each column has a datatype. The Structured Query Language (SQL) is suitable to relational databases to store and recover the data in a structured way. There are always fixed number of columns although additional columns can be added later. Most of the tables are related to each other with primary and foreign keys thus providing “Referential Integrity” among the objects. The key vendors are ORACLE, SQL Server, MySQL, PostgreSQL, and much more.
The idea of non-relational databases came into representation to handle rapid growth of unstructured data and scale them out effortlessly. This offers flexible schema so there is no such thing called “Referential Integrity” as we have seen in Relational databases. The data is highly de-normalised and do not require JOIN’s between objects. This reduces ACID property of relational databases and supports CAP (Consistency, Availability and Partitioning). As it is opposed by ACID, it will only support BASE (Basically Available Soft state, Eventual consistency). The initial databases created based on the following concepts, BigTable by Google, HBase by Yahoo, Cassandra by Facebook, etc.
Categories of Non-relational databases: The non-relational databases can be categorized into four major types such as Key-values database, column database, document database, and graph database.
Key-values database: This is the easiest form of NoSQL database where each value is associated with unique keys.
Column database: This database is proficient of storing and processing large amount of data using a pointer that points to many columns that are dispersed over a cluster.
Document database: This database might contain many key-value documents with many nested levels. Efficient Querying is possible with this database. The documents are stored in JSON format.
Graph database: Instead of traditional rows and columns, this database uses nodes and edges to signify graph structures and store data.