[Resent - original copy was not sent to list]
On Mon, 2005-11-28 at 13:01 +0200, oxo@??? wrote:
> What I want to know is whether it would be quicker to store everything
> in a MySQL database (or PostgreSQL or anything really, I'm not fussy) or
> in a flat text file. What I mean is relaying mail in a file like:
>
> foo.com: 192.168.4.1
>
> or put it in a MySQL database.
It depends.
If there are very few entries in the tables then probably nothing will
be faster than a flat text file.
If you have a fair number of entries then lookups are probably going to
be fastest with CDB files (SQL stuff, other than SQLite, will always
have at least two context switches on a uniprocessor box, and probably
aren't as fast as CDB anyhow). However CDB has disadvantages if there
are frequent updates (you rebuild the file each time - but it is atomic
which is wonderful) and possibly with very large data sets (the search
method is basically a linear search of a 32 bit key with an initial
table selection).
If the data is dynamic then something more databasey is probably best,
but you need to be careful of locking/update issues.
However for the situation you describe, where it sounds as though the
mail systems are semi-autonomous with periodic updates from a
configuration server, I'd go with CDB.
If anyone has any newer lookup benchmark data (I put some on the list,
but that was at least 7 years back) that would be interesting to see.
Nigel.
--
[ Nigel Metheringham Nigel.Metheringham@??? ]
[ - Comments in this message are my own and not ITO opinion/policy - ]