Data normalization is a way of ensuring that data is maintained in a way that prevents loss of data integrity. If the database structures are not normalized, erroneous code actions, user data-entry mistakes, or system or application failure during the update operation can lead to data corruption. The data corruption I am referring to here is the logical one, whereby the database files are correct but the information stored may be logically incorrect. To continue with the data layout section I need to explain few concepts of data normalization, so that you can understand why I'm organizing the data in a particular way.
Let's assume I want to implement one of the configuration section requirements; namely, to store the following information items:
• information about a sensor
• sensor options
• monitoring agent information
So I create a table with the following fields: hostname, address, sensor name, and sensor options. I then enter a few checks I want to perform on two monitoring agents:
hostname address sensor options my laptop my laptop remote server remote server
disk_check memory_check disk_check memory_check free_space total free_space total
Now let's say I want to update the address field of the remote server. Because the information is stored in two different rows, I need to make sure that all rows are going to be updated. If for some reason the application that attempts to update the database fails to identify all rows and update accordingly, I may end up with the following data in my table:
hostname address sensor options my laptop 127.0.0.1 disk_check free_space
Was this article helpful?