Relational and Non-relational Databases
A database is a means of storing information in which they can be received.
Relational databases present data with rows and columns and data in the table can be related according to common keys and concepts. The ability to retrieve related data forms the basis for the term relational database.
MySQL is a popular database management system (DBMS) for relational databases which is a system software for creating and managing databases.
The defining feature of relational databases is that it allows complex multi-row search queries. This is possible because a relational database has to have a database schema which represents the structure of the database defined when it gets created.
A schema describes the relationship between fields with primary keys, also called primary keyword, which are unique identifiers that a relational database must have. This then allows for queries based on relationships to be easily executed across the database.
The major downside of having a strict and rigid schema is that it doesn’t play well with changes. The initial stages of creating a web application involves rapid iteration, where the types of information to be stored in the database is always undergoing revision.
Adding a new column or field to a relational database often involves some sort of database migration which is a very time consuming and expensive operation. This is where non-relational databases come into play.
Non-relational databases also commonly known as NoSQL databases on the other hand allow for a storage of highly diverse data types due to the lack of a heavily constrained schema which enables users to rapidly build applications and iterate.
MongoDB which is a NoSQL database, for example stores data in JSON-like documents that can vary in structure. The structure of the database however, does not lend itself well to relational queries.