[Twisted-Python] twisted/persisted/dirdbm -- is this async-safe?

Jean-Paul Calderone exarkun at divmod.com
Mon Apr 14 13:30:15 EDT 2008


On Sat, 12 Apr 2008 21:54:19 -0400, Andy Fundinger <andy at newworldelectric.com> wrote:
>I'm developing a pretty general storage system as part of a larger twisted
>project, basically I just need dbm file type storage for now, until I get a
>better grip on my actual needs.  I'm expecting to use this as a test of
>Amazon SimpleDB, but the polarrose.amazon module apparently needs python 2.5
>which my server doesn't have yet.  So I need a somewhat interim solution and
>went looking for it, I was thinking twisted.persisted.dirdbm, but when I
>went to hook it up I noticed no deffereds at all.  Can anyone elaborate on
>how this works?  Is it going to slide my webserver to a halt while it hits
>the disk?  Should I be looking at a different module?

You shouldn't use anything from twisted.persisted.  None of it provides a
real storage solution.  In any case, none of it does asynchronous disk IO
so none of it will let your server handle network events while it's reading
or writing data.

If you don't need something that actually works while you figure out
what your requirements are, then maybe you don't need a real storage
solution and you can use twisted.persisted.dirdbm.  In this case, do
you really care if it blocks a little bit?  Disks are typically pretty
fast, and OS filesystem caches even faster.

Jean-Paul




More information about the Twisted-Python mailing list