Non-relational Database

Pragya Sapkota
2 min readOct 12, 2022

--

We discussed relational databases in my previous article here. And as we know there is one other type of database — a non-relational database. Let’s take this blog to understand the basic concept of a non-relational database.

A non-relational database is a less rigid database that provides more flexibility to the structure of data stored. The operations to store the data in a non-relational database present the data as ‘key-value’ pairs. Let’s see an example of data stored in a non-relational database as an array of ‘key-value’ pair objects.

[ {
name: 'Pragya',
rank: '1',
gender: 'F',
year: 2056,
},
{
name: 'Dipen',
rank: '3',
gender: 'M',
year: 2072,
},
{
........
},
............
]

As we talked about how and why the relational database is called a SQL database, the non-relational is by default the “NoSQL” database. There are some great benefits of not needing to consistently structure data under the NoSQL database.

BASE Transaction

Like the ACID (Atomicity, Consistency, Isolation, Durability) in the relational database — non-relational database or the NoSQL database has BASE transactions.

BA = Basically Available

S = Soft State

E = Eventual Consistency

Let’s explore them individually,

Basically Available

The first feature Basically Available promises us that the system will be highly available at any time of need.

Soft State

Likewise, the soft state tells us that the state of the system may change over time — sometimes even without input.

Eventual Consistency

The system can be consistent for a certain and short time unless other inputs are fed to it.

Conclusion

The non-relational database uses a hash-table-like structure whose concepts have been discussed here. This leads to fast and simple operations that are perfect for caching, environment variables, configuration files, session states, etc. Unlike relational databases, it can be used in both memory and persistent storage.

We have heard of some other “JSON-like” databases that are document databases among which we might have heard the most-loved one — MongoDB (Technically a BSON database). However, at the core, all of these are the ‘key-value’ stores too.

I hope this article was helpful to you.

Please don’t forget to applaud this article and follow me!!!

Any kind of feedback or comment is welcome!!!

You can also subscribe to my stories via email so that you’ll get notified whenever I bring out an article on a new subject.

Thank you for your time and support!!!!

Keep Reading!! Keep Learning!!!

--

--

Pragya Sapkota
Pragya Sapkota

Written by Pragya Sapkota

Hope and Patience😌 | Wisdom and Light😇⚡️

Responses (1)