[Twisted-Python] DirDBM possible bug

Jean-Paul Calderone exarkun at divmod.com
Fri Nov 9 13:39:44 EST 2007

On Fri, 09 Nov 2007 19:27:48 +0200, Giorgos Logiotatidis <seadog at sealabs.net> wrote:
>On Fri, 2007-11-09 at 12:04 -0500, Jean-Paul Calderone wrote:
>> However, I would strongly recommend against using DirDBM.  It's not very
>> good at all.
>Why isn't good? Poor code implemantation? I want to use it on an
>embedded system, to store dictionaries on flash memories so I can reduce
>memory footprint. Should I implement a different solution?

There seems to be a fairly obvious persistence mechanism for
domish.Elements: XML (as a string, in a normal file).

Why bring DirDBM, with the overhead of pickling, into it?

Aside from this, there's no guarantee that Elements you pickle
now will unpickle if you ever switch to a different version of
Twisted.  I suppose that since you are developing for an
embedded system, this may not be a serious concern.  DirDBM still
seems a bit out of the way, though.

There are also issues with the quality of the code and what features
it offers.  DirDBMs cannot be naively moved around in the filesystem,
they have certain undocumented restrictions (keys() relies on you not
adding any extra entries to the DirDBM directory, for example), and so
on.  As persistence systems go, it doesn't have a lot to recommend it.


More information about the Twisted-Python mailing list