|Syntactic Confectionery Delight|
CDB_Fileby ehdonhon (Curate)
|on Oct 03, 2001 at 05:26 UTC||Need Help??|
Item Description: Perl extension for access to cdb databases
General Summary: Good, but limited applications
The CDB_File module allows you to gain access to databases that are stored in the CDB format (by Dan Bernstein).
CDB_Files are very efficient when it comes to lookup speed. They are especially usefull when you have a large data set. The tradeoff is that CDB_Files are read-only.
If you want to update a CDB_File, you must pass a new hash of data to the CDB_File::create class method and then re-tie your old tied hash to gain access to the new data. This means if you are in a situation where you constantly need to be both acessing and updating your data file, the CDB_File format is probably not your best choice.
In benchmarking of CDB_Files vs DB_Files, I found that there is a considerable ammount of overhead in the process of tying a CDB_File vs. tying a regular DB_File, so if you are forced into a situation where you are tying a data file, accessing a single value, then un-tying, you may be better off with a DB_File (especially if you have a small data set)
If however, you have a situation where you are tying to a data file once, and doing multiple lookups with very little updates, you might want to consider CDB_Files as a very useful alternative to DB_Files.