DEV Community

Cover image for SQL vs NoSQL
Josh
Josh

Posted on

SQL vs NoSQL

Hello everyone! After taking some time off from blogging due to a busy school term I am back. For this post I am going to dive into the differences between SQL and NoSQL databases.

SQL is the default language for relational databases. A relational database stores data points that are related to each other and are represented in tables. Basic operations like insert, search, update, and delete can be performed among more complex tasks like optimizing and maintenance.

The relational model was developed in the early years of databases. Back then every application had its own unique way of storing data. In order to manage this each developer had to have a good understanding of the unique structure. This was inefficient and hard to maintain. The relational model was created to give a standardized approach to databases that could be used by any application. Over time SQL was developed as a way to write and query data in relational databases and for many years was the most widely used language.

NoSQL was developed in the early 2000’s with the intention of focusing on scaling and allowing frequent application changes. Instead of a tabular schema it opts to use a method that is optimized for the type of data that is being stored. Examples can be key-value pairs, JSON documents, or a graph. Non-relational databases do not have a standard language used to query data. Technically SQL could be used but it may not be efficient. When working on projects in my database class for school I used the MongoDB shell to structure queries.

When deciding which type of database will be best for a project there are a variety of factors to consider. SQL exceeds in transaction data where the structure doesn’t change frequently and integrity is important. Many financial institutions use relational databases due to its ACID (Atomicity, consistency, isolation, and durability) support. Due to it’s standardization, query efficiency is also much higher than non-relational databases. However, if the application needs scalability and flexibility this is where non-relational databases shine. They offer multiple data storage types that are easy to horizontally scale. This means that components of the data can be modified without changing the whole database or table.

Thank you for taking the time to read my post. If you enjoyed it feel free to leave a like or comment down below. See you all next time!

Resources:

  1. Nosql vs sql databases. MongoDB. (n.d.). https://www.mongodb.com/nosql-explained/nosql-vs-sql.

  2. Sql vs nosql: What's the difference between sql and nosql. Guru99. (n.d.). https://www.guru99.com/sql-vs-nosql.html.

  3. What is a relational database? Oracle. (n.d.). https://www.oracle.com/database/what-is-a-relational-database/.

  4. Chan, M. (2019, March 5). SQL vs. NoSQL - What's the best option for your database needs? Thorn Technologies. https://www.thorntech.com/sql-vs-nosql/.

  5. Non-relational data and NoSQL - Azure Architecture Center. Azure Architecture Center | Microsoft Docs. (2018, February 12). https://docs.microsoft.com/en-us/azure/architecture/data-guide/big-data/non-relational-data.

Top comments (0)