I am currently halfway through a Udemy course about building a full MERN stack application. MERN stands for MongoDB, Express, React, and Node.js. During my time at Flatiron school, we worked only with relational databases such as SQLite and PostgreSQL, therefore this was my first exposure to using a non-relational database (also known as NoSQL, which stands for not only SQL).
Relational vs Non-Relational Database
A relational database (also referred to as SQL database or RDBMS — relational database management system) is one that has tables containing rows and columns. It is possible to relate one table to another by using a join table, which combines columns from both tables into one. It is beneficial to use a relational database when accuracy is important (for example, financial applications). SQL databases are accurate because it has a fixed schema and will not accept data into the database if it is in the incorrect format.
A non-relational database stores its data in a non-tabular form, making it more flexible than SQL databases. It can store a variety of data models including key-value and document formats. The schemas in a NoSQL database are not fixed and therefore can accept a variety of data.
When to use a Non-Relational Database
It is beneficial to use a NoSQL database over a relational one when lot of complex and various data needs to be organized. A NoSQL database can quickly query through the data, unlike relational databases which sometimes need to look through several tables in order to find an answer. Additionally, I have found the NoSQL database (particularly MongoDB) to be very beginner friendly. It has a very easy user interface on their website that allows you to quickly browse your collections and see your data with the click of a button.
There is definitely a time and place for each of these database types in development, but I encourage anyone who has yet to try a non-relational database to do so because you will be pleasantly surprised.