Perl DBM与可存储 [英] Perl DBM vs. Storable
问题描述
对于我当前的项目,我需要在磁盘上存储一个小数据库,程序运行后我将读取该数据库,并将其写入一次.
for my current project i need to store a little database on disk, that i read once my program runs and write it once.
我研究了perls DBM功能,据我了解,它仅提供存储在磁盘上的哈希值,而每次读取和写入操作都直接进入磁盘.
I have looked into perls DBM functionality and from what I understand it provides merely a hash that is stored on disk with every read and write going directly to disk.
我的问题是:我不能简单地使用Storable
或任何相关模块来以更少的文件I/O开销实现相同的(持久性哈希)吗? (散列永远不会太大,以至于无法轻松地放入内存中)
My question is: Could I not simply use Storable
or any of the related modules to achieve the same (a persistent hash) with far less File I/O overhead? (The hashes will never be to large to fit into memory easily)
问候 尼克
推荐答案
SQLite 迅速成为简单在线操作的标准-磁盘数据库.在Perl中,您只需使用 DBD :: SQLite ,您就可以开始使用了.
SQLite is fast becoming the standard for simple on-disk databases. And in Perl you can just use DBD::SQLite and you're good to go.
这篇关于Perl DBM与可存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!