I currently use a lot of perl binary hash files stored in multiple file locations for loading data into this cgi website. I am debating whether mySQL would be faster or slower if I decide to store my data there.
Any insights? I understand that perl hashes are completely loaded into memory.
Gordon
Using a database means your lookups will be slower but your script will use less memory.
Using in-memory hashes means your lookups will be faster but your script will use more memory.
If you're not having memory troubles and your hashes will never get larger, then continue to use them.
If you're not having memory troubles and your hashes will get larger, then look into using a database.
If you're having memory troubles, use a database.
If you want to use a database for the sake of using a database (i.e. to learn new skills) then use a database.
If a Perl hash handles your data needs, you probably don't need the overhead of a full blown SQL database. There are a lot of storage alternatives for key->value storage such as the Berkley DB and the entire "NOSQL" movement. Google those and you'll find lots of info. Perl interfaces exist in CPAN for many of these.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With