[Tutor] Python database options

Kalle Svensson kalle@gnupung.net
Mon, 11 Feb 2002 15:42:13 +0100


[Brad Reisfeld]
[...]
> Options:
> 1. dictionary + pickle
> 2. dictionary + shelve
> 3. Gadfly
> 4. Berkeley DB + Python bindings
> 5. Postgres, MySQL + Python bindings
[...]
> What are the pros and cons of the options? Are there other viable
> options?

First off, as you feared, Gadfly seems to be unsupported.  It should
work on Python 2.1, but will generate a couple of warnings due to use
of deprecated modules.

If you only want to search on one or a few fields and don't need
pattern search (like 'get all lines where the 'user' field starts with
a 'd'), a DBM-based solution or a pickled dictionary should be ok.
Otherwise you will need a more sophisticated database, like Postgres
or MySQL, to get good performance.  I haven't used Berkeley DB and I'm
not aware of it's capabilities.  It might be good enough.

Peace,
  Kalle
-- 
Kalle Svensson (kalle@gnupung.net) - Laziness, impatience, hubris: Pick two!
English: http://www.gnupung.net/  Svenska: http://www.lysator.liu.se/~kalle/
Stuff: ["http://www.%s.org/" % x for x in "gnu debian python emacs".split()]