On 4 Feb 2004, at 03:16 pm, Bill Stephenson wrote:
As computers keep getting faster, and memory and storage cheaper, isn't it beneficial to program in the most simple, human readable, least learning required, method?

Never. You're not going to ever read each 2500 user's 2000 x 40kb records thus it's better to store it in a way that the computer can access it.



In short, I'm lazy. I'd rather code this all in perl. Do I really need to learn about and use MySQL or will computers get fast enough that it won't matter anyway.

Once again, no. Especially with where you're starting. 3 users and you might be OK. Have a think about this:
You have a file:
<XML><user><id>1</id><name>Bob</name></user><user><id>2</ id><name>Nancy</name></user></XML>



The first thing you're going to do with XML::Parser is turn the XML into a perl data structure:
@data = (
{ id => 1,
name => 'Bob'
},
{
id => 2,
name => 'Nancy'
}
);
Then you'll look through each element of the list looking for name eq 'Bob'. All you'll do all that in perl. Multiply the files by 2500 users then multiply by 40k of information. Perl wouldn't even be able to start to store it all.


On the other hand if you store the data directly in a database which has been optimised for quick searching and already has all the methods you'll ever require to store and retrieve data, you'll be running it as a compiled program. It will run a LOT faster and it will do it's job a LOT better.

It will also handle data-locking so you and I can't both be writing to a file at the same time.

In short there's no question about which is the better option. Databases are quicker and safer.

Cheers!
Rick



Rick Measham
Senior Designer and Developer

Printaform Pty Ltd
Tel: (03) 9850 3255
Fax: (03) 9850 3277
http://www.printaform.com.au
http://www.printsupply.com.au
vcard: http://www.printaform.com.au/staff/rickm.vcf



Reply via email to