我在早期的 Perl 项目中使用过 GDBM 和 Berkeley DB/DB_File,但我应该将它们用于新项目吗?不同 Perl DBM 实现的优缺点是什么?
(相关:当您只需要二进制/文本数据的透明哈希时,与传统 DBM 相比,DBM::Deep 或 KyotoCabinet 等工具是否太慢/太重?)
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.