logo


72.1.6 Problems with the Flat File Model


As you can see, the flat file model has some definite advantages: it’s quick, it’s simple, and it‘s easy to understand. However, as your business grows, you will begin to notice three problems with the model: Duplicate information, Uncertainty, and Wasted space.

Duplicate Information

Suppose you do that query, and you discover that you have three invoice records for Marie Jones; she has made three purchases. Your screen might look like this:

 

List of invoices

You notice that Marie's name, address, and phone number are repeated three times. You also recall that, each time you did an invoice for Marie, you had to type all of this information again. You notice, when looking at the data, that the address and phone information is not exactly the same in all records. Invoice #47 shows the address as 11 Oak and the other invoices say 1 Oak; Invoice #54 shows the phone as 477-1234 and the other invoices show the phone number as 437-1234. You wonder, “Which records are correct?”. You also wonder, “What happens if Marie ever changes her address or phone number? Should we go back to all of the invoices and update the address?”

This duplication of data is cumbersome and error-prone; you think, “There must be a better way.”

Uncertainty

Looking at those three invoices to Marie Jones, you also recall that, when you did the “Stationery” invoice, you actually wanted to be more specific in the Description field. You wanted to break the Stationery description down into Envelopes ($45.05) and Letterhead ($100.15). To allow for this finer level of detail, you decide to add more fields to the database.

Wasted Space

Whenever you add a new field to the database, the flat file model adds that new field to every record in the entire database so that the database will remain a perfect rectangle. This was a good feature in the case of the Address; however, it is a bad feature in the case of the Line Items. Why? Because even if a record has only one line item, the flat file is reserving storage space for three line items.



Harrowex Pty Ltd
http://www.hxmedical.com
Voice:+ 61 4 27 344 279
Fax: +61 3 52 439 019
static@hxmedical.com