Introduction to NoSQL

Jayamini samaratunga
5 min readMar 7, 2021

--

What is NoSQL?

NoSQL is an umbrella term to describe any alternative system to traditional SQL databases. It is a non relational DMS that doesn’t need a fixed schema and mainly centered on the concept of distributed database. NoSQL stands for “non SQL” or “not only SQL”. Either way, it’s commonly known that NoSQL databases are databases that store data in a format other than relational tables.

NoSQL databases are commonly misunderstood as they don’t store relationship data well because they store it differently than relational databases. In fact, comparing to SQL databases many find modeling relationship data in NoSQL to be easier because related data doesn’t have to be split between tables.

NoSQL data models allow related data to be nested within a single data structure.

Relational databases (RDBMS) like SQL is the basic model for database management. This traditional RDBMS uses SQL syntax to store and retrieve data. But with NoSQL structured, semi-structured, polymorphic and unstructured data can be stored across multiple processing nodes and doesn’t require fixed table schemas, usually avoids join operations, and typically scales horizontally.

Common features of NoSQL

Multiple NoSQL databases can be executed in the distributed mechanism by only providing eventual consistency.

Using shared nothing architecture it enables high distribution and less coordination.

Databases do not follow the relational schema and no complex feature like query languages, ACID and referential integrity joins.

NoSQL databases consist of free / relaxed schemas as there’s no need of the definition of the schema of the data.

Four Types of NoSQL Databases

Documented Databases

Stores data in documents similar to JASON(Java Script Object Notation) objects. Each key is paired with a complex structure called document where the value part is stored as the document. They can be horizontally scale out to accommodate large data volumes. These are commonly used for Blogging platforms, e-commerce applications and CMS systems etc.

examples: MongoDB, CouchDB, OrientDB, RavenDB

Graph Databases

They store data in nodes and edges, where nodes store information about people, places and things while edges store information about the relationships between the nodes. These databases are multi relational in nature. They are commonly used for social networks, fraud detection and recommendation engines.

examples: Infinite Graph, Flock DB, InfoGrid, Neo4J

Column Based

Traditional relational databases are row-oriented with each row having row-id and each field within the row stored together in a table. Here they are optimized for queries over large data sets and store columns of data together instead of rows. In column oriented DB you can easily add another column without affecting existing columns. but it is required to adapt all tables when adding an entire record and it makes row-oriented DB preferable over the column-oriented DB for online transaction processing(OLTP) as it frequently adds and change records. column-oriented DB commonly used for business intelligence, management of CRM etc.

examples: BigTable, Hypertable, HBase,Cassandra

Key-value Databases

They are a simpler type of databases where each item has keys and values of their own. Key can be used as a reference for the retrieval of the value, so learning how to query for a specific key-value pair is simple. This works best for shopping cart contents.

examples: DynanoDB, Redis, Scalaris, Memcached

When to Use NoSQL

When the data keep changing over time and is not structured.

The relationships between stored data are not that important.

Whenever a huge amount of data needs to be stored and retrieved.

Support of joins and constraints are not necessary at database level.

When data keeps growing continuously and database needs to be scaled regularly to handle it.

Advantages of Using NoSQL

High scalability.

High availability.

Simple to implement than RDBMS.

Eliminates the need for a specific caching layer to store data.

Supports key developer languages and platforms.

No need of allocating a high-performance server.

Disadvantages of NoSQL

NoSQL DB has very narrow focus as it is mainly designed for storage and it provides limited functionalities.

NoSQL being open-source DB, there’s no reliable standard for them yet.

Management challenge, as data management in NoSQL is much more complex than relational database.

large document size, as they store data in JASON like file which are quite large than others.

Backup, some databases like MongoDB has no approach for backup of data in a steady manner.

GUI not available, GUI mode tools to access the database is not flexibly available in the market.

Getting Started with NoSQL Databases

If you wish to learn NoSQL databases in detail, MongoDB Atlas would be a great start as it is fully managed by MongoDB and available on all leading cloud providers. Atlas has a forever free tier that you can use to kick the tires and discover the basics.

Conclusion

I hope you found this article useful! Give claps if you liked this as it would encourage me to write more. 👏

Thank you,

See you soon 😊

--

--

Jayamini samaratunga
Jayamini samaratunga

Written by Jayamini samaratunga

Software Engineering Undergraduate at SLIIT

No responses yet