| |
The Importance Of Normalization
By Bryan Young
Expert Author
Article Date: 2011-01-27
I am a programmer. When I begin a project, I look at it from a programming point of view. This is almost exactly the opposite of a database administrator's point of view.
My first attempts at creating a database structure were designed like C classes, with one or two main tables crammed full of data. This is bad design, and i have since realized that once I looked into normalizing my database design, life got a little bit simpler. There are three major reasons why normalization is important: wasted space, resource usage, and data integrity.
A non-normalized database is almost always filled with redundant data. Take for example a table of users and email addresses where you store the person's name, email address, and the email service they use. You're looking at two pieces of information that are unrelated to each other sharing space in your table. The goal is to split your data into much smaller units that are easier to access when you need to update something. By putting email providers into a separate table, you take up less space, because you aren't putting the entire domain into the table on every row.
When it comes to accessing that data, resources will be used. In the table we set up previously, if you need to change something about one service provider. Let's say for example you have 10,000 people who have "googlemail" addresses. To change them to "gmail", you would need to update 10,000 rows in your table. In a normalized structure, you would only need to change one row in one table to achieve the same result. Obviously, updating one row takes far fewer resources than updating 10,000 rows.
Undoubtedly the most important reason to normalize a database is data integrity. When we update "googlemail" to "gmail" in our original table, there are several reasons why the query can fail, leaving half of our users not updated. This update failure has now damaged your database queries, as you will not get the data you think you are getting. Once normalized, your database will be smaller, faster, and more stable, not to mention easier to use.
About the Author:
Bryan Young is a staff writer for WebProNews.
|
|