This course focuses on relational databases, where data is organized into tables in a structured manner. There are relationships and dependencies between the tables. You use SQL to query the data in a very specific format through the tables, columns, and rows. Each table is made up of one topic or object. The columns represent the data points that need to be stored. The rows represent the records of the data points. This type of relational database structure makes it easy to sort, filter, and compute various calculations with expressive query languages.
A non-relational database has more of a document-oriented structure. All of the data about a particular object is stored within the document. A non-relational database has a less structured format. It offers high scalability, flexibility with data models, and adaptability to the needs of the organization.
2a. When to use a Non-relational Database If you're working with data that isn’t clearly defined and organized, and you can't establish defined tables and relationships in the data set, then you might want to consider a non-relational database. The information that is gathered in a non-relational database isn’t structured to be segmented into tables and defined relationships.
EXAMPLE
A messaging application like Facebook Messenger is a good example of the need for a non-relational database. With so much unstructured information that gets included within a message, the messages have to be stored in a non-relational database for efficiency.2b. Main Types of Non-relational Databases There are four main types of non-relational databases:
One of the most common examples of a non-relational database is a NoSQL database, which uses an approach to database design that enables the storage and querying of data outside the traditional structures found in relational databases.
NoSQL databases have a flexible data model which makes it easy to store and combine data of any structure and allow us to dynamically modify the schema without any down time. In contrast, making changes to the data model in a relational database can take time and planning to implement. Since the NoSQL databases are built on performance and scalability, they are set up to be able to quickly scale out, offering unlimited growth in comparison to relational databases. They are also designed for highly available systems so that they can provide a consistent, high-quality experience for all users around the world.
Relational databases, on the other hand, use the expressive query languages to access and modify data. They also use indexes within the database to provide efficient access to data rather than maintained in the application code for non-relational databases. With the relational models, there’s much stronger consistency through the primary and foreign keys such that applications should be able to read what has been written to the database immediately.
Source: Authored by Vincent Tran