Perl DBM实现的优缺点? (GDBM,Berkeley DB等)

时间:2011-06-27 17:33:12

标签: perl dbm

我已经将GDBM和Berkeley DB / DB_File用于早期的Perl项目,但是我应该将它们用于新项目吗?不同的Perl DBM实现有哪些优缺点?

(相关:与传统的DBM相比,像DBM :: Deep或KyotoCabinet这样的工具是否太慢/太重,当你需要的只是二进制/文本数据的透明哈希?)

1 个答案:

答案 0 :(得分:5)

AnyDBM_File模块有各种dbms的漂亮图表。我不知道这是怎么过时的。

                         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.