best small database?

Magnus Lycka lycka at carmen.se
Thu Sep 14 07:47:06 EDT 2006


David Isaac wrote:
> I have no experience with database applications.
> This database will likely hold only a few hundred items,
> including both textfiles and binary files.
> 
> I would like a pure Python solution to the extent reasonable.
> 
> Suggestions?

You haven't provided enough requirements for us
to make any intelligent suggestions. Perhaps you
might learn something from reading through my old
EuroPython presentation.

http://www.thinkware.se/cgi-bin/thinki.cgi/DatabaseProgrammingWithPython

Relational databases with SQL syntax provides a convenient
way to store data with an appropriate structure. You can
always force a tool into handling things it wasn't designed
for, but SQL database work best when you have strict, well
defined structures, such as in accounting systems, booking
systems etc. It gives you a declarative query language,
transaction handling, typically multi user support and
varying degrees of scalability and high availability
features.

For you, it's probably overkill, and if you have files
to start with, keeping them in the file system is the
natural thing to do. That means that you can use a lot
of standard tools to access, manipulate, backup and search
through them. Perhaps you rather need a search engine for
the file system?

Do you intend to store information concerning how these
files relate to each other? Perhaps it's better in that
case to just keep that relationship information in some
small database system, and to keep the actual files in
the file system.

Perhaps it's enough to keep an XML file with the structure,
and to use something like ElementTree to manipulate that
XML structure.

You gain a lot of power, robustness and flexibility by
using some kind of plain text format. Simple files play
well with configuration management systems, backup systems,
editors, standard search tools, etc. If you use XML, it's
also easier to transform your structural information to
some presentable layout through standard techniques such
as XSL.




More information about the Python-list mailing list