This article was originally published at https://www.blog.duomly.com/6-most-popular-backend-questions-and-answers-for-beginners/#what-is-relational-database
A relational database is an organized collection of data, where we can create relations between the certain point of the data.
The relational database is often organized by tables, which consist of the columns with data attributes. Each row of the relational database table holds a record of the data with the unique identifier; most often, it's id. Each record assigns the value to the attribute.
In the relational database, we can keep thousands or millions of data records.
Relational databases use SQL (Structured Query Language), to read, store, update, and delete the data from the database. SQL syntax is very similar to plain English language, so it's not very complicated to use.
Relations in the relation database are set between the different tables, established based on the interaction between those tables.
Let's take a look at the visual representation of the tables models, connected by the relation to the other table model.
In the image above, you can see the models of the three tables: users, posts, and comments. Users are related to posts and comments by id, wherein the posts and in a comment, it's the author_id. Then posts and comments are related by the post_id.
It allows developers to get the data of the author of the post without saving it again the post table, just by asking for the data of the user by user id from the users' table.
Relational Database Management System is a software that allows managing the database by creating, updating, and administrating the relational database. The most popular ones are:
MySQL - mostly used with PHP websites, integrated with WordPress;
OracleDB - mostly used with a huge amount of data in large applications, often used in banking;
PostgreSQL - open-source database, easy to use and inexpensive, can handle big amounts of data, but it can be a little slower in performance;
The most important question you might ask before starting a new project is which type of database you should use, relational or non relational. Here are some benefits of using the relational database:
- data can be easily categorized and sort, so later it's easy to query filtered information;
- data is accurate, which means it's stored just once and you can avoid the duplicating information;
- relational databases are secure because the access can be limited to specific users;
- the flexibility of getting data, even with a little more complicated queries;
Based on the benefits listed above, I could easily say that relational databases are a great solution for big projects, with large amounts of structured data.
Thank you for reading,
Anna from Duomly