9

I've used GDBM and Berkeley DB/DB_File for earlier Perl projects, but should I be using them for new ones? What are the pros and cons of different Perl DBM implementations?

(Related: Are tools like DBM::Deep or KyotoCabinet too slow/heavy compared to traditional DBMs, when all you need is a transparent hash for binary/text data?)

Nakilon
  • 34,866
  • 14
  • 107
  • 142
Anirvan
  • 6,214
  • 5
  • 39
  • 53

1 Answers1

4

The AnyDBM_File module has a nice chart for the various dbms. I don't know how out of date this is though.

                         odbm    ndbm    sdbm    gdbm    bsd-db
                         ----    ----    ----    ----    ------
 Linkage comes w/ perl   yes     yes     yes     yes     yes
 Src comes w/ perl       no      no      yes     no      no
 Comes w/ many unix os   yes     yes[0]  no      no      no
 Builds ok on !unix      ?       ?       yes     yes     ?
 Code Size               ?       ?       small   big     big
 Database Size           ?       ?       small   big?    ok[1]
 Speed                   ?       ?       slow    ok      fast
 FTPable                 no      no      yes     yes     yes
 Easy to build          N/A     N/A      yes     yes     ok[2]
 Size limits             1k      4k      1k[3]   none    none
 Byte-order independent  no      no      no      no      yes
 Licensing restrictions  ?       ?       no      yes     no

 [0] on mixed universe machines, may be in the bsd compat library, which
     is often shunned.
 [1] Can be trimmed if you compile for one access method.
 [2] See DB_File.  Requires symbolic links.
 [3] By default, but can be redefined.
Chas. Owens
  • 64,182
  • 22
  • 135
  • 226
  • 1
    That omits the `BerkeleyDB` module, which has certain advantages; the “bsd-db” it names there is the `DB_File` module, which is a simpler interface. – tchrist Jun 27 '11 at 22:36
  • Also [CDB](http://search.cpan.org/search?query=cdb) – daxim Jun 28 '11 at 09:37