4 Types of NoSQL Databases

4 Types of NoSQL Database

NoSQL databases: key-value store, document store, column-oriented database, and graph database.

There are four main types of NoSQL databases: key-value store, document store, column-oriented database, and graph database. Each type addresses problems that relational databases can't solve.

NoSQL databases vs Sql databases

NoSQL databases are non-relational DBMSs that do not require a fixed schema, avoid joins, and are easy to scale. They are designed for distributed data stores with massive data storage needs. NoSQL databases are used for big data and real-time web applications. Companies like Twitter, Facebook, and Google collect terabytes of user data daily.

NoSQL databases vs Sql databases

NoSQL stands for "Not Only SQL" or "Not SQL." Introduced by Carl Strozzi in 1998, NoSQL databases can store structured, semi-structured, unstructured, and polymorphic data, unlike traditional RDBMS which uses SQL syntax.

Traditional RDBMS uses SQL syntax to store and retrieve data for further insights. Instead, a NoSQL database system encompasses a wide range of database technologies that can store structured, semi-structured, unstructured, and polymorphic data.

Why Use NoSQL?

The concept of NoSQL databases became popular with internet giants like Google, Facebook, and Amazon, who handle huge volumes of data. The system response time slows down when using RDBMS for massive volumes of data.

To resolve this, we could "scale up" our systems by upgrading existing hardware, but this process is expensive.

Alternatively, we can distribute the database load across multiple hosts as the load increases, known as "scaling out."

Why Use NoSQL?

NoSQL databases are non-relational, so they scale out better than relational databases and are designed with web applications in mind.

Features of NoSQL

1. Non-relational

  • NoSQL databases never follow the relational model.
  • They do not provide tables with flat fixed-column records.
  • Work with self-contained aggregates or BLOBs.
  • Doesn't require object-relational mapping and data normalization.
  • No complex features like query languages, query planners.
  • No referential integrity joins or ACID properties.

2. Schema-free

  • NoSQL databases are either schema-free or have relaxed schemas.
  • No need to define the schema of the data.
  • Supports heterogeneous data structures within the same domain.
Schema-free NoSQL database

3. Simple API

  • Offers easy-to-use interfaces for storing and querying data.
  • APIs allow low-level data manipulation and selection methods.
  • Uses text-based protocols, often HTTP REST with JSON.
  • No standard query language is used.
  • Web-enabled databases running as internet-facing services.

4. Distributed

  • NoSQL databases can be executed in a distributed manner.
  • Offers auto-scaling and fail-over capabilities.
  • Often sacrifices ACID properties for scalability and throughput.
  • No synchronous replication between distributed nodes; uses asynchronous multi-master replication.
  • Provides eventual consistency.
  • Uses Shared Nothing Architecture for higher distribution.

Types of NoSQL Databases

Types of NoSQL databases

Four Major Types of NoSQL Databases

  • Key-value store
  • Document store
  • Column-oriented database
  • Graph database

Each type solves problems that relational databases can't address.

Key-Value Pair Based

Data is stored in key/value pairs, designed to handle large amounts of data and heavy load.

Key-value pair storage databases use a hash table where each key is unique, and the value can be a JSON, BLOB (Binary Large Object), string, etc.

Key-value store structure
Key-value stores store everything as a key and a value.

The value in a key-value store can be anything: a string, a number, or an entirely new set of key-value pairs within an object.

Examples of key-value stores include Redis, Voldemort, Riak, and Amazon's DynamoDB.

Key-value nested structure
Key-value nested structure.

Document-Oriented:

Document stores are one step up in complexity from key-value stores: a document store does assume a certain document structure that can be specified with a schema. Document stores appear the most natural among the NoSQL database types because they’re designed to store everyday documents as is, and they allow for complex querying and calculations on this often already aggregated form of data. The way things are stored in a relational database makes sense from a normalization point of view: everything should be stored only once and connected via foreign keys. Document stores care little about normalization as long as the data is in a structure that makes sense. A relational data model doesn’t always fit well with certain business cases.

Newspapers or magazines, for example, contain articles. To store these in a relational database, you need to chop them up first: the article text goes in one table, the author and all the information about the author in another, and comments on the article when published on a website go in yet another. As shown below, a newspaper article can also be stored as a single entity; this lowers the cognitive burden of working with the data for those used to seeing articles all the time.

Amazon SimpleDBCouchDBMongoDBRiakLotus Notes are popular Document originated DBMS systems.

document databases nosql

Document stores save documents as a whole, whereas RDMS cuts up the article and saves it in several tables.

Column-based

Column-oriented databases work on columns and are based on BigTable paper by GoogleEvery column is treated separatelyThe values of single column databases are stored contiguously.

Column-based databases nosql

They deliver high performance on aggregation queries like SUM, COUNT, AVG, MIN, etc. as the data is readily available in a column.

Column-based NoSQL databases are widely used to manage data warehousesbusiness intelligenceCRM, Library card catalogs,

HBaseCassandraHBaseHypertable are examples of a column-based database.

Graph-Based

A graph type database stores entities as well the relations amongst those entities. The entity is stored as a node with the relationship as edges. An edge gives a relationship between nodes. Every node and edge has a unique identifier.

Graph-Based dtabases

Compared to a relational database where tables are loosely connected, a Graph database is a multi-relational in natureTraversing relationships as fast as they are already captured into the DB, and there is no need to calculate them.

Graph base databases mostly used for social networkslogisticsspatial data.

Neo4JInfinite GraphOrientDBFlockDB are some popular graph-based databases.

 

Query Mechanism tools for NoSQL

The most common data retrieval mechanism is the REST-based retrieval of a value based on its key/ID with GET resource

Document store Database offers more difficult queries as they understand the value in a key-value pair. For example, CouchDB allows defining views with MapReduce.

Advantages of NoSQL
 

Advantages of NoSQL

  • Can be used as Primary or Analytic Data Source
  • Big Data Capability
  • No Single Point of Failure
  • Easy Replication
  • No Need for Separate Caching Layer
  • It provides fast performance and horizontal scalability.
  • Can handle structured, semi-structured, and unstructured data with equal effect
  • Object-oriented programming which is easy to use and flexible
  • NoSQL databases don’t need a dedicated high-performance server
  • Support Key Developer Languages and Platforms
  • Simple to implement than using RDBMS
  • It can serve as the primary data source for online applications.
  • Handles big data which manages data velocity, variety, volume, and complexity
  • Excels at distributed database and multi-data center operations
  • Eliminates the need for a specific caching layer to store data
  • Offers a flexible schema design which can easily be altered without downtime or service disruption

Disadvantages of NoSQL

  • No standardization rules
  • Limited query capabilities
  • RDBMS databases and tools are comparatively mature
  • It does not offer any traditional database capabilities, like consistency when multiple transactions are performed simultaneously.
  • When the volume of data increases it is difficult to maintain unique values as keys become difficult
  • Doesn’t work as well with relational data
  • The learning curve is stiff for new developers
  • Open-source options so not so popular for enterprises.

NoSql Technical Comparison Report.

 

Add comment