Working on your next project but not sure which back-end technology to use? For starters, databases come in two flavors: relational and non-relational. Both have their own set of rules, pros and cons which help in determining which type of application they should be used in. Let us delve into these differences so that we would be able to decide which one is better suited for us.

Relational Databases:

Relational databases store data in the form of tables containing rows (representing entries) and columns (containing a set of information) having a unique key for each row. These keys can either be primary or foreign. It is based on a form of algebraic set theory known as relational algebra, which is used in the relational modeling of data. They are better suited for applications where many transactions are involved, also known as transactions-oriented applications (OLTP).

They use SQL (Structured Query Language) as a language for the maintenance and querying of databases. We can use MySQL, SQL Server, SQLite, MS Access, Oracle, Sybase, PostGreSQL, or Informix.

They are normalized databases i.e they are in accordance with a series of so-called “normal forms” in order to reduce data redundancy and improve data integrity.

Advantages:

  1. They are useful for applications requiring a lot of transactions, complex queries and routine analysis of data

  2. They are robust, simple, structured and flexible.

  3. They ensure reliable data transactions through ACID (Atomity, Consistency, Isolation, Durability).

  4. Easier to use because of GUI (Graphical User Interface)

Disadvantages:

  1. Their main disadvantage is that it is impossible to horizontally scale them. If our business requirements increase, then we need to move on to bigger systems, making them more costly in the long run.

  2. Images and other multimedia files cannot be stored.

  3. We cannot use them for geospatial data

  4. They can cause ORM Impedance Mismatch

Here_ is a basic CRUD demo of __MySQL _using Node.js. You need to install the relevant software before running the examples in the repository.

#non-relational-database #mysql #relational-databases #nodejs #mongodb

To Relational or Not to Relational?
1.30 GEEK