Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Review: CDB_File

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.

In reply to CDB_File by ehdonhon

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2023-09-27 14:07 GMT
Find Nodes?
    Voting Booth?

    No recent polls found