As the computers progressed through different stages, computer scientists realized that the real-life information of humans could be stored through a digital solution called database. With the rising processing and storage demand, pen and paper were not enough to handle the requirements of mankind. As a result, relational databases made an entry in the 1970s. All the information was saved on the databases through a query language called SQL (Structured Query Language).
Relational databases were a massive hit, and businesses of all scales began designing schemas, relations, and database designs to manage their clients and customer bases. However, data continued increasing at a rapid pace.
As more technologies emerged and the web and mobile platforms accelerated, discussions were held about the feasibility of relational databases in today’s world. Similarly, the ability of DBMS systems to handle a massive number database request was also part of the discussion where real-time interactions like those of social media platforms have increased the data requirements.
What Is NoSQL?
NoSQL stands for ‘Not Only SQL’. NoSQL database is an approach where the traditional concepts of database management systems are not followed. NoSQL databases are required when enterprise systems have issues related to the performance and scalability of their application.
NoSQL has been especially deemed suitable and fit for the requirements of modern day web applications where it is a part of the MEAN (MongoDB Express Angular Node JS) and MERN (MongoDB Express Angular Node JS) technology stacks. These web development stacks have been insanely popular in the recent years where the NoSQL database models are either slowly used as an additional tool or are used to completely replace the RDBMS systems.
Types of NoSQL Databases
There are four key types of NoSQL databases that store information in different ways.
Key-Value Data Store
In key-value DBs, data is stored through a distinct series of key-value pairs, which is similar to the concept of dictionaries. This means that a key can only be linked with a single value of a collection. As a result, the simplicity of the application is increased as a simple query that can generate the required result with a key-value data store.
Additionally, it also negates the need of a query language like SQL. Now the question arises, when should you use the key-value data store? Well, if you have are developing a social media platform, then you can save the profiles of the users through key-value data store.
Similarly, if you are managing a blog, then the comments of your fan following can be stored through a key-value data store. Social media platforms like Twitter and Pinterest are already using key-value data store for their newsfeeds and user profiles.
See the following example where our key is a list of countries that have cities as their values.
Key | Value |
USA | {“New York, San Diego, Seattle”} |
India | {“Mumbai, Chennai, Delhi“} |
Canada | {“Toronto, Vancouver, Montreal”} |
Example of KeyValue store
These are Key-value store options.
Aerospike, Apache Ignite, ArangoDB, Berkeley DB, Couchbase, Dynamo, FoundationDB, InfinityDB, MemcacheDB, MUMPS, Oracle NoSQL Database, OrientDB, Redis, Riak, SciDB, ZooKeeper
Column Store
Traditional DBMS always store and process data horizontally using rows. However, the rows are not stored together in the disk and, thus, accessing different rows can be slow for the database retrieval purposes.
In the case of a column store, the horizontal concept of storing and retrieving data is completely changed. Instead, a new approach has been designed where data can be stored in columns. These columns are combined together into column families. A column family can have countless columns that may either have to be generated at the runtime or at the time of specifying a schema. Column store is useful because the disk saves the column data continuously, which makes searching and accessing data for retrieval purposes easier and faster.
Column DBs is used by Spotify to manage the metadata related information of the music industry. Facebook also uses Column stores for searching mechanisms and personalization.
Example of Column store
These are Column options.
Accumulo, Cassandra, Druid, HBase, Vertica.
Document Store
In a document store DB, different data formats can be saved. These include the common JSON (JavasScript Object Notation), XML (Extensible Markup Language) or BSON (Binary Encoding of the JSON) data.
Hence, the document store provides a level of flexibility that was previously unimaginable with the relational database approach. It is similar to the key-value store in its storage mechanism of key-value pairs, but here all the values are called ‘documents’.
Additionally, the values also have encoding and structure related information. For example, see the following instance where our values are stored in the form of a document. All of the following instances are related to the address of offices. However, you can see how they can be represented in different formats.
{officeName:”ABC 1”,
{Street: “B-329, City:”Mumbai”, Pincode:”806923”}
}
{officeName:”ABC 2”,
{ Block:”A, 2nd Floor”, City: “Chennai”, Pincode: 400452”}
}
{officeName:”ABC 3”,
{Latitude:”60.257314”, Longitude:”-80.495292”}
}
We can also query our searches through the details of the data in the document. For instance, in the above example, we can use the city ‘Mumbai’ for all the data related to the “ABC offices”.
The popular gaming franchise SEGA utilizes the document store approach through MongoDB for its management of more than 10 million gaming accounts. Similarly, the real-time weather functionalities in Android and iOS are provided through the document store model.
Example of Document store
These are document store option
Apache CouchDB, ArangoDB, BaseX, Clusterpoint, Couchbase, Cosmos DB, IBM Domino, MarkLogic, MongoDB, OrientDB, Qizx, RethinkDB
Graph Database
As the name suggests, graph databases use a graphical representation. Like the CS algorithm of the graph, there are nodes, edges, and other related components in graph databases. A graph database is useful to tackle the scalability issues of the applications. In graph databases, entities are represented by the nodes, while the association is linked through relationships. Each node contains records of relationships. For example, suppose a social media network where users know each other.
Example of Column store
These are Key-value store options.
AllegroGraph, ArangoDB, InfiniteGraph, Apache Giraph, MarkLogic, Neo4J, OrientDB, Virtuoso
Final Thoughts
With the rising application development needs and demands, NoSQL databases serve as an excellent solution. Whether you are managing an e-commerce store or you are intending to create the next big app, the traditional databases may not always fulfill your needs. With the help of a NoSQL database, you can get an instant performance boost, and your applications will be able to handle requests with enhanced optimization.