Best PracticesUsing Record Update Pages to Archive Data Rather Than Record Deletion Pages to Delete Data


As you can probably tell, I am not a big fan of deleting data. Because data deletion is permanent, it often poses more problems that if you had simply archived the data and hidden it away from the world. Back when storage was costly and the size of databases was a constant concern, deletion was a necessary evil and part of the cost of doing business. In today's market, however, the cost of storage has dropped significantly and databases have become more efficient in the way they store data to ensure the optimal size of their tables. As a result, the cost of deleting data and losing the information has now outweighed the cost of storing the data and we, as web developers, should be looking at archiving data instead of deleting it.

The most common model I use to accommodate archiving is to create a field in each of my tables called "archived". If this field is set to yes or 1 (depending on the database), I don't ever display the data to anyone. If the field is set to no or 0, the data is visible to the end users. While this method is easy to implement, your tables will eventually become bloated with records that have been archived.

Another common model that alleviates the bloating problem is to set an expiration date for each record, review it prior to that expiration date, and then migrate those records that have expired to a secondary archive table. Following this model minimizes the number of records stored in your table and ensures that your dynamic web pages aren't adversely affected by having to sift through lots of archived data.

These are just two of the common methods used to archive data instead of deleting it. Regardless of whether you choose to implement one of these methods or another archiving method, the value of this type of model becomes evident when you are asked to restore data. Rather than having to perform restore operations from tape backup and risk losing data that may have been written since the backup, you are able to go into the database and reset the archive value or migrate the record from the archive table to the active table and the data is now available again.



Special Edition Using Macromedia Studio 8
Special Edition Using Macromedia Studio 8
ISBN: 0789733854
EAN: 2147483647
Year: 2003
Pages: 337

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net