NoSQL Databases with its types

Sandesh Deshmane
4 min readFeb 11, 2024

What is SQL Data Database

SQL databases are relational databases. They use structured query language SQL to do data manipulation/ definition. They have predefined schemas which determine the structure of data that you want to work with, this means all your data should follow the same structure. You need to have a thorough analysis of your data to fix the structure and making changes to the database once the data is populated is difficult. Altering production databases is always a challenge. These databases are better for multi-row transactions. Most of the SQL databases are vertically scalable.

What is a NoSQL Database

NoSQL is a non-relational database. They have dynamic schemas to save unstructured data. They are better for document data or JSON,key-value, graph or wide-column storage. They can be column-oriented, document-oriented, graph-based or saved as key-value stores.

This gives flexibility to add fields at any time.

Why use a NoSQL Database

The popularity of NoSQL databases over the last decade or so has been driven by an explosion of data. Before what’s commonly described as ‘the big data revolution’, relational databases were the norm — these are databases that contain structured data. Structured data can only be structured if it is based on an existing schema that defines the relationships (hence relational) between the data inside the database.

However, with the vast quantities of data that are now available to just about every business with an internet connection, relational databases simply aren’t equipped to handle the complexity and scale of large datasets.

Types of NoSQL

There are four types of NoSQL: key-value store, document store, column-oriented database, and graph database. Each database type tries to solve a problem that can’t be solved with relational databases.

Let's see in depth about each NoSQL Type.

Key Value Store

A key–value database, or key–value store, is a data storage paradigm designed for storing, retrieving, and managing associative arrays, and a data structure more commonly known today as a dictionary or hash table. Dictionaries contain a collection of objects, or records, which in turn have many different fields within them, each containing data. These records are stored and retrieved using a key that uniquely identifies the record, and is used to find the data within the database.

Examples of key-value Store

Redis, Aerospike, Amazon DynamoDB, Microsoft Cosmos DB, RocksDB, Orient DB

Column Oriented Database

A column-oriented database is a non-relational database that stores the data in columns instead of rows. That means when we want to run analytics on a small number of columns, you can read those columns directly without consuming memory with the unwanted data.

Columnar databases are designed to read data more efficiently and retrieve the data with greater speed. A columnar database is used to store a large amount of data. Key features of columnar oriented database:

  • Scalability.
  • Compression.
  • Very responsive.

Examples of column-oriented Database: Apache Cassandra, Snowflake, Google BigQuery, ClickHouse, TinyBird, Apache Druid

Document Store

A document database, also known as a document-oriented database, is a type of NoSQL database that stores, retrieves, and manages document-like data, typically in the form of JSON or BSON documents. In a document database, each document is a self-contained unit of data with key-value pairs or nested structures, making it flexible for representing complex and hierarchical data. Document databases are schema-less, allowing for dynamic and evolving data structures.

Examples of document databases are: MongoDB, Amazon Document DB, CouchDB, Elastic Search

Graph Databases

A graph database is a type of NoSQL database that uses graph structures with nodes, edges, and properties to represent and store data. In a graph database, data relationships are as important as the data itself. This allows for efficient querying and traversal of complex relationships between entities. Here’s a brief explanation of the key components:

  • Node: Represents an entity or a data point in the graph.
  • Edge: Represents a relationship between nodes.
  • Property: Key-value pairs associated with nodes or edges.

Graph databases excel in scenarios where the relationships between entities are crucial, such as social networks, fraud detection, recommendation engines, and network analysis

Examples of Graph DB: Neo4j, Amazon Neptune, ArangoDB, OrientDB etc

--

--