Re: [exim] Different MySQL connections for different jobs

Top Page
Delete this message
Reply to this message
Author: W B Hacker
Date:  
To: exim users
Subject: Re: [exim] Different MySQL connections for different jobs
Mike Cardwell wrote:

> Hi,
>
> I have a master database. I replicate that out to slave databases that
> sit locally on each mail server. Exim then reads configuration from
> those local copies.
>
> I now have a need to write to the database from exim as well. I obviously
> can't write to the local read only slave copies of the database.


With minor modification, perhaps you can do.

Presuming you auto-timestamp entries, edits, updates, simply write to the local
copy.

Then - before the master pushes new data, it can query the local copies for any
entry newer than its last 'pushed update' timestamp, retreive only the altered
records, if any, merge them into the master, THEN push a new update.

In-use (with R:Base for DOS) since 1200 bps was a fast modem...
Works like a champ.

> I need
> to write to the master.



> Is there a way of setting up more than one MySQL
> server in an exim configuration and then explicitly choosing which one
> to use when you run a query? I'm guessing not, but still thought I'd
> ask...
>
> I could hack around it by writing a daemon which listens for socket
> connections from exim, and then "proxies" commands to the master db. That
> would be nasty though.
>
> I nice solution would be for you to be able to do:
>
> hide mysql_servers = named_database1=localhost/dbname1/dbuser1/dbpass1: \
>                      named_database2=otherhost/dbname2/dbuser2/dbpass2

>
> And then name your database in the lookup:
>
> ${lookup mysql{named_database1}{THE QUERY}{$value}}
>
> Or similar.
>


Now *that* would be generally useful indeed....

Wonder what happens with present code if one were to have a

'hide mysql_servers..'

AND a

'hide pgsql_servers...'

(or other, different RDBMS...)

Bill