NoSQL Databases: Understanding the What? Why? When? How?

Dipendra Pant
5 min readJul 7, 2020
Books arranged inside a library

There are predictions that NoSQL is the future, In this article let's understand is it possible by digging in about NoSQL.The article consists of the following:

1- Brief History of NoSQL

2- What is NoSQL?

3- Guiding Principle of NoSQL

4- How NoSQL works?

5- Types of NoSQL

6- Comparison of NoSQL and SQLs

7- When to go for NoSQL?

8- Limitation of NoSQL

9- Is NoSQL the future?

1- History:

Term NoSQL was first introduced in 1998 by Carlo Strozzi but was not that popular till 2009 when a Senior Software Consultant Eric Evans reignited the term in 2009 by a twitter hashtag highlighting the importance of NoSQL Databases before that a popular NoSQL database MongoDB was already established in 2007 though. After that, it became widely popular and popularity was at peak around 2013 -2014 as shown by Google Trends. According to a research paper in 2016 “there is more than 225 kind of NoSQL databases”.And some are so popular that even tech giants like Google are using it.

2- What is NoSQL:

NoSQL means “Not Only SQL” but more than that as it addresses many limitations of SQL databases, it is not the only SQL because it is Non-Tabular (Non-Relational) and stores data differently than SQLs.

Definition would be NoSQL is non-relational,distributed,open-source,horizontally scalable,dynamic schema,cluster friendly database.

  • Non-Relational: Store data in the nontabular form and no concept of tables and connections.
  • Dynamic Schema: RDBMS has static schema means whereas NoSQL has dynamic schema or often called Schemaless, Denormalized, allowing to store dissimilar data together
  • Cluster-friendly” means that the database can easily be distributed on multiple machines and as NoSQL is distributed hence its cluster friendly.

3- Guiding Principals:

RDBMS guiding principle was ACID(Atomicity, Consistency, Isolated, Durability) Properties, but most NoSQL doesn’t support them except some support the AID of ACID property of it.

Here the guiding principle of NoSQL Databases is the CAP theorem introduced by Professor Eric A. Brewer in 2000. CAP theorem tells a distributed database cannot have all three features Consistency, Availability, Partition Tolerant but can have only two of them. And to be NoSQL database Partition Tolerant is compulsory so one can choose either of one among availability and consistency. Also if the database has both Consistency and Availablity then its RDBMS as explained by the diagram below.

Figure 1: CAP theorem “Principle behind NoSQL”

4- How NoSQL Works:

Working of NoSQL is same as SQL/RDBMS as there is the interaction between the client, server, and database but the difference in NoSQL is the data model, which means data are stored and managed differently them traditional RDBMS and the NoSQL database system is highly optimized for append and read operations. The data model is the types of NoSQL database i.e, Key-Value, Document, Column, Graph. Working is illustrated by the diagram below

Figure 2: Diagram showing NoSQL working

5- Types of NoSQL Databases:

Figure 3: Types of NoSQL Databases

i- Document-Based Databases:

Let us understand the document-based database using MongoDB Architecture with the figure below:

Figure 4: Document-Based Database MongoDB Architecture

In document-based there is a database which can consist of multiple collections, the collection is a large chunk of related data inside which there are documents a document is a JSON file storing data. For example, as shown in the right side of the figure, If 2nd Semester is a database then the collection would be the subjects in the second semester i.e, ADBMS, AI, DS, and the Documents would be the assignments, report writing, and quizzes are taken in each subject respectively.

ii- Key-Value NoSQL:

Key-Value uses the simple concept of associating corresponding values with keys, where the key(attribute name) is non-volatile and value(attribute value) is persistent.

Figure 5: Key-Value Database

iii- Wide Column/Column Based Database:

Stores Data as column Family, which has rows and rows has many columns that are associated with row key as illustrated by the diagram.

Figure 6: Wide Column Database Example

iv- Graph Database:

Graph-Based Databases are based on the graph theory and it contains entities and relationships where entities are the node and relationships are the edges. The relationship between nodes is predefined which makes read and append faster. As illustrated by the diagram below

Figure 7: Graph Database Example

6- Comparison of NoSQL

The relational database has its advantages and NoSQL has its own which is shown in the table below based on this one can make choice:

Table 1: Comparison of RDMBS and NoSQL

Besides that, if the following points matter largely in your application then go for NoSQL.

Figure 8: NoSQL Features

7- Limitations of NoSQL:

i- Immature:

As it came into existence lately ignited in 1998 reignited after 2009 i.e, around 2005, whereas SQL database came in 1974 so NoSQL is less matured as compared to it. Hence often less used by enterprises.

ii- No common standards:

NoSQL lacks standards like SQL Query, also lack of standardization has made learning difficult for developers as a developer knowing a document-based NoSQL might have difficulty in learning Graph database.

iii- Less Secure:

NoSQL is considered less secure from a data security perspective as compared to SQL databases, but research is ongoing to make it more secure.

iv- Less Reliability and No ACID

Overall NoSQLs are considered less reliable also as most of NoSQL databases don’t obey ACID property.

Is NoSQL is the Future?

Finally here comes the question is NoSQL the future, I believe the following

  • NoSQL has been increasing with the growth in big data, cloud computing uses and may increase more.
  • May not completely replace SQL but compliments it in a way that they both exist.
  • Technologies like AI, ML, IoT, Blockchain, Big Data are Buzzword so it may dominate.
  • Search for technology that incorporates the features of SQL and NoSql and also bridges the gap between them is on like, “NewSQL” which combines the features of both SQL and NoSQL databases and addresses their limitations/gaps too.

References

[1] https://sci-hub.tw/https://ieeexplore.ieee.org/abstract/document/7979888

[2]https://www.researchgate.net/profile/Shelly_Sachdeva2/publication/323057709_NoSQL_databases_Critical_analysis_and_comparison/links/5c580d23458515a4c7570a34/NoSQL-databases-Critical-analysis-and-comparison.pdf

[3] https://www.freecodecamp.org/news/nosql-databases-5f6639ed9574/

[4] https://hazelcast.com/glossary/key-value-store/

[5]https://www.geeksforgeeks.org/what-is-mongodb-working-and-features/

[6]https://www.researchgate.net/profile/Mohamed_Mohamed69/publication/263272704_Relational_Vs_NoSQL_databases_A_survey/links/00b7d53a495312ad22000000/Relational-Vs-NoSQL-databases-A-survey.pdf

[7]https://www.mongodb.com/nosql-explained

--

--

Dipendra Pant

Python, OpenCV, Evidence Based Software Engineering, Artificial Intelligent Technologies