Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Perl's Hash vs BerkeleyDB vs MySQL

by ioannis (Vicar)
on May 09, 2006 at 10:09 UTC ( #548167=note: print w/ replies, xml ) Need Help??


in reply to Perl's Hash vs BerkeleyDB vs MySQL

Previous replies focused on ACID properties, with this post I observe other kinds of differences:

Advantages of Perl Hash:

  • Easy to store a structure as value
  • Easy to later add more hashes (databases) , but in db4 you commit on it ahead of time.
  • Easier to store multiple values for a key (arrayref)
  • No need to worry about recovery and proper shutdown

Advantages of BerkelyDB (not the same as DB_File):

  • Easier to access values bases on combination of keys and values
  • Can to construct cursors (iterators)
  • Can construct custom indexes (not yet supported in the DB4 Perl api)
  • The first 4k of data are in memory, the rest on disk
  • Can add callbacks to modify the standard access and retrieval methods.

Comparisons with SQL databases miss the whole point of an embedded database. DB4 is not a multi-process system; it is an embedded database, a a C library intended meant to run in the same address space with the main program (when not using rpc). The general advantages and disadvantages of stand-alone models versus the client-server model should be noted.


Comment on Re: Perl's Hash vs BerkeleyDB vs MySQL
Replies are listed 'Best First'.
Re^2: Perl's Hash vs BerkeleyDB vs MySQL
by herveus (Parson) on May 09, 2006 at 11:46 UTC
    Howdy!

    ...of course, you can have both if you use SQLite, as it's an embedded database *with* SQL and all those goodies...

    yours,
    Michael
Re^2: Perl's Hash vs BerkeleyDB vs MySQL
by perrin (Chancellor) on May 09, 2006 at 12:53 UTC
    A lot more than 4K of the BerkeleyDB data might also be in memory, in the shared memory cache.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://548167]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2015-07-28 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls