Why Design a Relational Database?
Episode #1 of the course Relational database design by Ben Brumm
Welcome to the course!
My name is Ben, and I’m a software developer and website owner specializing in all things related to databases.
Over the next ten days, you’ll learn how to design a relational database the right way.
You can use this when designing a database for a project at work or for a personal project you’re working on outside of work.
Today, we’ll learn about why it’s important to have a well-designed database.
What Is a Relational Database?
A relational database is a database used to store data. It’s commonly used by websites and applications, and it’s designed to allow for data to be added, updated, deleted, and viewed very easily.
For this to happen, it needs to be designed in an effective way.
What are the advantages or benefits of having a well-designed database?
Easy to Expand
Having a database that is well-designed allows you to easily expand the database in the future.
In many cases, when you design a database for a website or application, the database is made to store a certain amount of data.
As time passes and the website or application gets used more (either by you or by other users), then the database captures and stores more and more information.
If the database is poorly designed, the more information it stores, the slower the database runs. This can cause the website or application to slow down and even have errors when running.
If it’s designed well, the database will easily be able to handle more records. Once you start getting into situations where you’re storing millions of records, it’s much easier to improve the performance if the database is well-designed.
Removes Duplicate Information
Another advantage of designing your database properly is ensuring that information is not duplicated.
If you set it up correctly, your database should store each piece of information once and once only.
For example, if you create a user account, you should only store the username in one place. If you store it in several places in the database, it can cause issues when trying to update the data in the future or trying to locate the most up-to-date version of the information.
Having information stored in one place and one place only is a big benefit of using a relational database. It helps developers by saving time and can also make the application or website run better, as it knows where to get the data from.
Prevent Inconsistent and Incomplete Data
Along with removing duplicate data, an advantage of a well-designed database is ensuring that the data you capture is consistent and complete.
You can enforce the rules you have for your website or application within the database so that the data you capture is high-quality.
For example, if you have a rule that says “every order must have a delivery address,” then you can ensure that the delivery address component of an order is always populated or linked.
You can also ensure that data is viewed or entered in a specific and consistent way. For example, if you want to allow a user to specify a country, you can provide them with a list of values for this, which are stored in your database. This will ensure that the value you capture for “country” is consistent.
Another benefit of a well-designed database is the opportunity for increased security.
Many database systems allow for security to be implemented in various ways.
For example, you can allow only certain users or applications to view certain tables or pieces of data. Perhaps regular users cannot see an employee’s salary value, but HR or administrator users can.
This can be done within the application or website, but it can also be enforced in the database so that all applications obey this rule.
So, those are just some of the benefits of a well-designed relational database.
In the next lesson, we’ll cover how to get started designing your database by defining the goal and determining the requirements, as well as how to document your design.
Until next time,
“Database Design for Mere Mortals: A Hands-On Guide to Relational Database Design” by Michael J. Hernandez
Share with friends