Open In App

Non-Relational Databases and Their Types

Last Updated : 13 Oct, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Non-relational databases, also known as No-SQL databases. Unlike traditional relational databases(SQL), they do not depend on a fixed schema, allowing for easier handling of unstructured data.

Non-relational databases are ideal for handling large volumes of data and are highly efficient in distributed environments. To understand non-relational databases, or “NoSQL” databases, we first need to look at SQL or relational databases.

What is Relational Database?

Key Features of Relational Databases

Key Features of Relational Databases

Key features of relational database:

  • Relational data models are similar to an Excel spreadsheet, with related data stored in rows and columns in one table.
  • SQL (Structured Query Language) is the most common way of interacting with relational database systems. Developers can write SQL queries to perform CRUD (create, read, update, delete) operations.

SQL was specifically designed to work with tabular data. These are often categorized as structured data. This is because there can only be a single schema or structure for the data within a relational database. SQL is a declarative language, which means that you describe in SQL syntax the desired result you wish from the query.

What is a Non-Relational database?

Non-relational databases different from relational databases because they do not store data in tabular form. Instead, non-relational databases are based on data structures like documents and graphs. No-SQL databases also come in a variety of types based on their data models.

They offer scalability when dealing with large volumes of data and high load factors. They were designed when data was expected to be partitioned across multiple machines to scale, in contrast to relational databases, which assumed the data would stay on a single machine.

Non-Relational Database Types:

There are four main types of non-relational databases: key/value, graph, column, and document.

Non Relational Databases

Non Relational Databases

1. Key/Value-

Key/ Value Database

Key/ Value Database

Key-value databases use a straightforward schema: a unique key is paired with a collection of values, where the values can be anything from a string to a large binary object. One of the benefits of using this structure in a database is that you don’t have to worry about complex queries. Because the system knows where the data is stored, it only sends a request to that particular server.

Example:

Key

Value

Name

John Snow

Age

23

2. Graph Database-

Graph Database

Graph Database

Graph database is another type of non-relational database. A popular example of a graph database is Neo4J. This database stores information as a collection of nodes and edges, where the edges represent the relationships between the nodes.

3. Column Oriented-

Wide Column

Wide Column

A column-oriented or wide-column non-relational database is primarily designed for analytics. Cassandra is a commonly used column-oriented database. The advantage of column-oriented/row-oriented databases is that column-oriented databases return data in columns, making the query much more performant as it will not return many irrelevant fields that are not required for the query being serviced. The primary key in a column-oriented database is the data or value, which is then mapped to row keys. This is the inverse, or opposite, of how the primary key works in a relational database.

Example:

Example of Column Oriented

4. Document Database –

Document Database

Document databases, such as MongoDB, store data in a single document, which can have different shapes within the single collection or table that stores the documents. It provides a clear means of capturing relationships using sub-documents and embedded arrays within a single document.

Example:

Document Database Example

Conclusion

In conclusion,  non-relational databases offer a flexible and scalable solution for managing large volumes of unstructured data. They are particularly useful for applications that require high performance and low latency. There are four main types of non-relational databases: key-value, document, column oriented, and graph database.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads