This is not a Perl question per se. That is, I am not asking a
language question, but a design question. But I will be writing the
code in Perl and it is likely a common issue.
Here is the situation. My site will have pages that will have a
dynamic number items, each with there own associated fields. Let's say
it is a list of books with pub date, etc. for each book. The customer
can add books to their personal list, remove books, change the field
contents, etc. The information will then be stored in a MySQL DB.
Here is my question. Suppose we have this list and the customer makes
some changes and says save. The "simplest" solution is to delete all
of the old entries for that particular book list and write the new
ones from the page. The drawback I see is that I lose, unless I work
to keep it, original date. Plus I am doing some "unnecessary" DB
writes. Most importantly since I am not looking I have no idea which
items were changed and which were not. My gut tells me that I will
care which items where changed and when, but I don't have a
specification for that at the moment.
Supposing that DB size is not an issue at all and that, after
reliability, I care most about speed (customer apparent speed), what
is the best approach to this?
TIA.
--
Matt Silberstein
Well ya see, Norm, it's like this. A herd of buffalo can only move as fast as the slowest buffalo. And when the herd is hunted, it is the slowest and weakest ones at the back that are killed first. This natural selection is good for the herd as a whole, because the general speed and health of the whole group keeps improving by the regular killing of the weakest members. In much the same way, the human brain can only operate as fast as the slowest brain cells. Excessive intake of alcohol, as we know, kills brain cells. But naturally, it attacks the slowest and weakest brain cells first. In this way, regular consumption of beer eliminates the weaker brain cells, making the brain a faster and more efficient machine. That's why you always feel smarter after a few beers.
Cliff on Cheers